Skip to content

Commit

Permalink
Upgrade Rollup build process
Browse files Browse the repository at this point in the history
  • Loading branch information
kitten committed Apr 16, 2020
1 parent 069c9c1 commit ec20bbf
Show file tree
Hide file tree
Showing 3 changed files with 284 additions and 83 deletions.
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,16 @@
"object-is": "^1.1.2"
},
"devDependencies": {
"@ampproject/rollup-plugin-closure-compiler": "^0.25.2",
"@babel/core": "^7.9.0",
"@babel/plugin-transform-flow-strip-types": "^7.9.0",
"@babel/plugin-transform-object-assign": "^7.8.3",
"@babel/preset-env": "^7.9.5",
"@babel/preset-flow": "^7.9.0",
"@babel/preset-react": "^7.9.4",
"@rollup/plugin-buble": "^0.21.3",
"@rollup/plugin-commonjs": "^11.1.0",
"@rollup/plugin-node-resolve": "^7.1.3",
"babel-plugin-closure-elimination": "^1.3.0",
"babel-plugin-transform-async-to-promises": "^0.8.15",
"codecov": "^3.6.5",
Expand All @@ -81,9 +85,6 @@
"react-is": "^16.13.1",
"rollup": "^2.6.1",
"rollup-plugin-babel": "^4.4.0",
"rollup-plugin-buble": "^0.19.8",
"rollup-plugin-commonjs": "^10.1.0",
"rollup-plugin-node-resolve": "^5.2.0",
"rollup-plugin-replace": "^2.2.0",
"rollup-plugin-terser": "^5.3.0"
}
Expand Down
13 changes: 9 additions & 4 deletions rollup.config.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import commonjs from 'rollup-plugin-commonjs'
import nodeResolve from 'rollup-plugin-node-resolve'
import buble from 'rollup-plugin-buble'
import commonjs from '@rollup/plugin-commonjs'
import nodeResolve from '@rollup/plugin-node-resolve'
import buble from '@rollup/plugin-buble'
import babel from 'rollup-plugin-babel'
import { terser } from 'rollup-plugin-terser'
import compiler from '@ampproject/rollup-plugin-closure-compiler'
import replace from 'rollup-plugin-replace'

const pkgInfo = require('./package.json')
Expand All @@ -19,7 +20,7 @@ if (pkgInfo.dependencies) {
}

const externalPredicate = new RegExp(`^(${external.join('|')})($|/)`)
const externalTest = id => {
const externalTest = (id) => {
if (id === 'babel-plugin-transform-async-to-promises/helpers') {
return false
}
Expand Down Expand Up @@ -117,6 +118,10 @@ const makePlugins = (isProduction = false) => [
replace({
'process.env.NODE_ENV': JSON.stringify('production')
}),
isProduction &&
compiler({
compilation_level: 'SIMPLE_OPTIMIZATIONS'
}),
isProduction ? terserMinified : terserPretty
]

Expand Down
Loading

0 comments on commit ec20bbf

Please sign in to comment.