Browse Source

build: bump rollup version

dev
Evan You 7 years ago
parent
commit
4361a2b3ae
  1. 16
      build/build.js
  2. 14
      build/config.js
  3. 111
      package-lock.json
  4. 10
      package.json

16
build/build.js

@ -14,12 +14,12 @@ let builds = require('./config').getAllBuilds()
if (process.argv[2]) {
const filters = process.argv[2].split(',')
builds = builds.filter(b => {
return filters.some(f => b.dest.indexOf(f) > -1)
return filters.some(f => b.output.file.indexOf(f) > -1)
})
} else {
// filter out weex builds by default
builds = builds.filter(b => {
return b.dest.indexOf('weex') === -1
return b.output.file.indexOf('weex') === -1
})
}
@ -41,12 +41,14 @@ function build (builds) {
}
function buildEntry (config) {
const isProd = /min\.js$/.test(config.dest)
const output = config.output
const { file, banner } = output
const isProd = /min\.js$/.test(file)
return rollup.rollup(config)
.then(bundle => bundle.generate(config))
.then(bundle => bundle.generate(output))
.then(({ code }) => {
if (isProd) {
var minified = (config.banner ? config.banner + '\n' : '') + uglify.minify(code, {
var minified = (banner ? banner + '\n' : '') + uglify.minify(code, {
output: {
ascii_only: true
},
@ -54,9 +56,9 @@ function buildEntry (config) {
pure_funcs: ['makeMap']
}
}).code
return write(config.dest, minified, true)
return write(file, minified, true)
} else {
return write(config.dest, code)
return write(file, code)
}
})
}

14
build/config.js

@ -161,12 +161,8 @@ const builds = {
function genConfig (opts) {
const config = {
entry: opts.entry,
dest: opts.dest,
input: opts.entry,
external: opts.external,
format: opts.format,
banner: opts.banner,
moduleName: opts.moduleName || 'Vue',
plugins: [
replace({
__WEEX__: !!opts.weex,
@ -176,7 +172,13 @@ function genConfig (opts) {
flow(),
buble(),
alias(Object.assign({}, aliases, opts.alias))
].concat(opts.plugins || [])
].concat(opts.plugins || []),
output: {
file: opts.dest,
format: opts.format,
banner: opts.banner,
name: opts.moduleName || 'Vue'
}
}
if (opts.env) {

111
package-lock.json

@ -1263,9 +1263,9 @@
}
},
"buble": {
"version": "0.15.2",
"resolved": "https://registry.npmjs.org/buble/-/buble-0.15.2.tgz",
"integrity": "sha1-VH/EdIP45egXbYKqXrzLGDsC1hM=",
"version": "0.16.0",
"resolved": "https://registry.npmjs.org/buble/-/buble-0.16.0.tgz",
"integrity": "sha512-Eb5vt1+IvXXPyYD1IIQIuaBwIuJOSWQ2kXzULlg5I83aLGF2qzcjRU2joYusnWFgAenvJ9xTOMvZvT0bb8BLbg==",
"dev": true,
"requires": {
"acorn": "3.3.0",
@ -1274,7 +1274,8 @@
"chalk": "1.1.3",
"magic-string": "0.14.0",
"minimist": "1.2.0",
"os-homedir": "1.0.2"
"os-homedir": "1.0.2",
"vlq": "0.2.2"
},
"dependencies": {
"minimist": {
@ -7643,13 +7644,10 @@
}
},
"rollup": {
"version": "0.45.2",
"resolved": "https://registry.npmjs.org/rollup/-/rollup-0.45.2.tgz",
"integrity": "sha512-2+bq5GQSrocdhr+M92mOQRmF1evtLRzv9NdmEC2wo7BILvTG8irHCtD0q+zg8ikNu63iJicdN5IzyxAXRTFKOQ==",
"dev": true,
"requires": {
"source-map-support": "0.4.16"
}
"version": "0.50.0",
"resolved": "https://registry.npmjs.org/rollup/-/rollup-0.50.0.tgz",
"integrity": "sha512-7RqCBQ9iwsOBPkjYgoIaeUij606mSkDMExP0NT7QDI3bqkHYQHrQ83uoNIXwPcQm/vP2VbsUz3kiyZZ1qPlLTQ==",
"dev": true
},
"rollup-plugin-alias": {
"version": "1.3.1",
@ -7661,25 +7659,62 @@
}
},
"rollup-plugin-babel": {
"version": "2.7.1",
"resolved": "https://registry.npmjs.org/rollup-plugin-babel/-/rollup-plugin-babel-2.7.1.tgz",
"integrity": "sha1-FlKBl7D5OKFTb0RoPHqT1XMYL1c=",
"version": "3.0.2",
"resolved": "https://registry.npmjs.org/rollup-plugin-babel/-/rollup-plugin-babel-3.0.2.tgz",
"integrity": "sha512-ALGPBFtwJZcYHsNPM6RGJlEncTzAARPvZOGjNPZgDe5hS5t6sJGjiOWibEFVEz5LQN7S7spvCBILaS4N1Cql2w==",
"dev": true,
"requires": {
"babel-core": "6.26.0",
"babel-plugin-transform-es2015-classes": "6.24.1",
"object-assign": "4.1.1",
"rollup-pluginutils": "1.5.2"
}
},
"rollup-plugin-buble": {
"version": "0.15.0",
"resolved": "https://registry.npmjs.org/rollup-plugin-buble/-/rollup-plugin-buble-0.15.0.tgz",
"integrity": "sha1-g8PonH/SJmx5GPQbo5gDE1Gcf9A=",
"version": "0.16.0",
"resolved": "https://registry.npmjs.org/rollup-plugin-buble/-/rollup-plugin-buble-0.16.0.tgz",
"integrity": "sha512-dPIvH9iK9AUGRrqpARL6TTNY85BJpc5OK5PiCAnFaRe7C1boRBVRXiL0SYsYNVnyYYPl6vu0lVSb722eMSw1Eg==",
"dev": true,
"requires": {
"buble": "0.15.2",
"rollup-pluginutils": "1.5.2"
"buble": "0.16.0",
"rollup-pluginutils": "2.0.1"
},
"dependencies": {
"buble": {
"version": "0.16.0",
"resolved": "https://registry.npmjs.org/buble/-/buble-0.16.0.tgz",
"integrity": "sha512-Eb5vt1+IvXXPyYD1IIQIuaBwIuJOSWQ2kXzULlg5I83aLGF2qzcjRU2joYusnWFgAenvJ9xTOMvZvT0bb8BLbg==",
"dev": true,
"requires": {
"acorn": "3.3.0",
"acorn-jsx": "3.0.1",
"acorn-object-spread": "1.0.0",
"chalk": "1.1.3",
"magic-string": "0.14.0",
"minimist": "1.2.0",
"os-homedir": "1.0.2",
"vlq": "0.2.2"
}
},
"estree-walker": {
"version": "0.3.1",
"resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-0.3.1.tgz",
"integrity": "sha1-5rGlHPcpJSTnI3wxLl/mZgwc4ao=",
"dev": true
},
"minimist": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz",
"integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=",
"dev": true
},
"rollup-pluginutils": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/rollup-pluginutils/-/rollup-pluginutils-2.0.1.tgz",
"integrity": "sha1-fslbNXP2VDpGpkYb2afFRFJdD8A=",
"dev": true,
"requires": {
"estree-walker": "0.3.1",
"micromatch": "2.3.11"
}
}
}
},
"rollup-plugin-commonjs": {
@ -7759,24 +7794,40 @@
}
},
"rollup-plugin-replace": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/rollup-plugin-replace/-/rollup-plugin-replace-1.1.1.tgz",
"integrity": "sha1-OWMV3tBQps5DuVGKiGo/YO+x6jM=",
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/rollup-plugin-replace/-/rollup-plugin-replace-2.0.0.tgz",
"integrity": "sha512-pK9mTd/FNrhtBxcTBXoh0YOwRIShV0gGhv9qvUtNcXHxIMRZMXqfiZKVBmCRGp8/2DJRy62z2JUE7/5tP6WxOQ==",
"dev": true,
"requires": {
"magic-string": "0.15.2",
"magic-string": "0.22.4",
"minimatch": "3.0.4",
"rollup-pluginutils": "1.5.2"
"rollup-pluginutils": "2.0.1"
},
"dependencies": {
"estree-walker": {
"version": "0.3.1",
"resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-0.3.1.tgz",
"integrity": "sha1-5rGlHPcpJSTnI3wxLl/mZgwc4ao=",
"dev": true
},
"magic-string": {
"version": "0.15.2",
"resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.15.2.tgz",
"integrity": "sha1-BoHXOIdBu8Ot2qZQYJkmJMbAnpw=",
"version": "0.22.4",
"resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.22.4.tgz",
"integrity": "sha512-kxBL06p6iO2qPBHsqGK2b3cRwiRGpnmSuVWNhwHcMX7qJOUr1HvricYP1LZOCdkQBUp0jiWg2d6WJwR3vYgByw==",
"dev": true,
"requires": {
"vlq": "0.2.2"
}
},
"rollup-pluginutils": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/rollup-pluginutils/-/rollup-pluginutils-2.0.1.tgz",
"integrity": "sha1-fslbNXP2VDpGpkYb2afFRFJdD8A=",
"dev": true,
"requires": {
"estree-walker": "0.3.1",
"micromatch": "2.3.11"
}
}
}
},

10
package.json

@ -66,7 +66,7 @@
"babel-plugin-transform-vue-jsx": "^3.4.3",
"babel-preset-es2015": "^6.24.1",
"babel-preset-flow-vue": "^1.0.0",
"buble": "^0.15.2",
"buble": "^0.16.0",
"chalk": "^1.1.3",
"chromedriver": "^2.30.1",
"codecov.io": "^0.1.6",
@ -107,14 +107,14 @@
"nightwatch-helpers": "^1.2.0",
"phantomjs-prebuilt": "^2.1.14",
"resolve": "^1.3.3",
"rollup": "^0.45.1",
"rollup": "^0.50.0",
"rollup-plugin-alias": "^1.3.1",
"rollup-plugin-babel": "^2.7.1",
"rollup-plugin-buble": "^0.15.0",
"rollup-plugin-babel": "^3.0.2",
"rollup-plugin-buble": "^0.16.0",
"rollup-plugin-commonjs": "^8.0.2",
"rollup-plugin-flow-no-whitespace": "^1.0.0",
"rollup-plugin-node-resolve": "^3.0.0",
"rollup-plugin-replace": "^1.1.1",
"rollup-plugin-replace": "^2.0.0",
"rollup-watch": "^4.0.0",
"selenium-server": "^2.53.1",
"serialize-javascript": "^1.3.0",

Loading…
Cancel
Save