Browse Source

build: upgrade rollup

dev
Evan You 7 years ago
parent
commit
b0b6b7e972
  1. 33
      build/build.js
  2. 2
      package.json
  3. 10
      yarn.lock

33
build/build.js

@ -42,22 +42,23 @@ function build (builds) {
function buildEntry (config) {
const isProd = /min\.js$/.test(config.dest)
return rollup.rollup(config).then(bundle => {
const code = bundle.generate(config).code
if (isProd) {
var minified = (config.banner ? config.banner + '\n' : '') + uglify.minify(code, {
output: {
ascii_only: true
},
compress: {
pure_funcs: ['makeMap']
}
}).code
return write(config.dest, minified, true)
} else {
return write(config.dest, code)
}
})
return rollup.rollup(config)
.then(bundle => bundle.generate(config))
.then(({ code }) => {
if (isProd) {
var minified = (config.banner ? config.banner + '\n' : '') + uglify.minify(code, {
output: {
ascii_only: true
},
compress: {
pure_funcs: ['makeMap']
}
}).code
return write(config.dest, minified, true)
} else {
return write(config.dest, code)
}
})
}
function write (dest, code, zip) {

2
package.json

@ -106,7 +106,7 @@
"nightwatch-helpers": "^1.2.0",
"phantomjs-prebuilt": "^2.1.14",
"resolve": "^1.3.3",
"rollup": "^0.43.0",
"rollup": "^0.45.1",
"rollup-plugin-alias": "^1.3.1",
"rollup-plugin-babel": "^2.7.1",
"rollup-plugin-buble": "^0.15.0",

10
yarn.lock

@ -4714,9 +4714,9 @@ rollup-watch@^4.0.0:
chokidar "^1.7.0"
require-relative "0.8.7"
rollup@^0.43.0:
version "0.43.0"
resolved "https://registry.yarnpkg.com/rollup/-/rollup-0.43.0.tgz#b36bdb75fa5e0823b6de8aee18ff7b5655520543"
rollup@^0.45.1:
version "0.45.1"
resolved "https://registry.yarnpkg.com/rollup/-/rollup-0.45.1.tgz#af67ded79974079095b5fede8817b4ec26d610e1"
dependencies:
source-map-support "^0.4.0"
@ -4816,7 +4816,7 @@ shebang-regex@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-1.0.0.tgz#da42f49740c0b42db2ca9728571cb190c98efea3"
shelljs@0.7.6, shelljs@^0.7.5:
shelljs@0.7.6:
version "0.7.6"
resolved "https://registry.yarnpkg.com/shelljs/-/shelljs-0.7.6.tgz#379cccfb56b91c8601e4793356eb5382924de9ad"
dependencies:
@ -4824,7 +4824,7 @@ shelljs@0.7.6, shelljs@^0.7.5:
interpret "^1.0.0"
rechoir "^0.6.2"
shelljs@^0.7.8:
shelljs@^0.7.5, shelljs@^0.7.8:
version "0.7.8"
resolved "https://registry.yarnpkg.com/shelljs/-/shelljs-0.7.8.tgz#decbcf874b0d1e5fb72e14b164a9683048e9acb3"
dependencies:

Loading…
Cancel
Save