Skip to content

Commit

Permalink
build: upgrade rollup
Browse files Browse the repository at this point in the history
  • Loading branch information
yyx990803 committed Jul 11, 2017
1 parent 0a9aab5 commit b0b6b7e
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 22 deletions.
33 changes: 17 additions & 16 deletions build/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
10 changes: 5 additions & 5 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down Expand Up @@ -4816,15 +4816,15 @@ shebang-regex@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-1.0.0.tgz#da42f49740c0b42db2ca9728571cb190c98efea3"

[email protected], shelljs@^0.7.5:
[email protected]:
version "0.7.6"
resolved "https://registry.yarnpkg.com/shelljs/-/shelljs-0.7.6.tgz#379cccfb56b91c8601e4793356eb5382924de9ad"
dependencies:
glob "^7.0.0"
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:
Expand Down

0 comments on commit b0b6b7e

Please sign in to comment.