Skip to content

Commit 4361a2b

Browse files
committed
build: bump rollup version
1 parent df868c7 commit 4361a2b

File tree

4 files changed

+103
-48
lines changed

4 files changed

+103
-48
lines changed

build/build.js

+9-7
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@ let builds = require('./config').getAllBuilds()
1414
if (process.argv[2]) {
1515
const filters = process.argv[2].split(',')
1616
builds = builds.filter(b => {
17-
return filters.some(f => b.dest.indexOf(f) > -1)
17+
return filters.some(f => b.output.file.indexOf(f) > -1)
1818
})
1919
} else {
2020
// filter out weex builds by default
2121
builds = builds.filter(b => {
22-
return b.dest.indexOf('weex') === -1
22+
return b.output.file.indexOf('weex') === -1
2323
})
2424
}
2525

@@ -41,22 +41,24 @@ function build (builds) {
4141
}
4242

4343
function buildEntry (config) {
44-
const isProd = /min\.js$/.test(config.dest)
44+
const output = config.output
45+
const { file, banner } = output
46+
const isProd = /min\.js$/.test(file)
4547
return rollup.rollup(config)
46-
.then(bundle => bundle.generate(config))
48+
.then(bundle => bundle.generate(output))
4749
.then(({ code }) => {
4850
if (isProd) {
49-
var minified = (config.banner ? config.banner + '\n' : '') + uglify.minify(code, {
51+
var minified = (banner ? banner + '\n' : '') + uglify.minify(code, {
5052
output: {
5153
ascii_only: true
5254
},
5355
compress: {
5456
pure_funcs: ['makeMap']
5557
}
5658
}).code
57-
return write(config.dest, minified, true)
59+
return write(file, minified, true)
5860
} else {
59-
return write(config.dest, code)
61+
return write(file, code)
6062
}
6163
})
6264
}

build/config.js

+8-6
Original file line numberDiff line numberDiff line change
@@ -161,12 +161,8 @@ const builds = {
161161

162162
function genConfig (opts) {
163163
const config = {
164-
entry: opts.entry,
165-
dest: opts.dest,
164+
input: opts.entry,
166165
external: opts.external,
167-
format: opts.format,
168-
banner: opts.banner,
169-
moduleName: opts.moduleName || 'Vue',
170166
plugins: [
171167
replace({
172168
__WEEX__: !!opts.weex,
@@ -176,7 +172,13 @@ function genConfig (opts) {
176172
flow(),
177173
buble(),
178174
alias(Object.assign({}, aliases, opts.alias))
179-
].concat(opts.plugins || [])
175+
].concat(opts.plugins || []),
176+
output: {
177+
file: opts.dest,
178+
format: opts.format,
179+
banner: opts.banner,
180+
name: opts.moduleName || 'Vue'
181+
}
180182
}
181183

182184
if (opts.env) {

package-lock.json

+81-30
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+5-5
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@
6666
"babel-plugin-transform-vue-jsx": "^3.4.3",
6767
"babel-preset-es2015": "^6.24.1",
6868
"babel-preset-flow-vue": "^1.0.0",
69-
"buble": "^0.15.2",
69+
"buble": "^0.16.0",
7070
"chalk": "^1.1.3",
7171
"chromedriver": "^2.30.1",
7272
"codecov.io": "^0.1.6",
@@ -107,14 +107,14 @@
107107
"nightwatch-helpers": "^1.2.0",
108108
"phantomjs-prebuilt": "^2.1.14",
109109
"resolve": "^1.3.3",
110-
"rollup": "^0.45.1",
110+
"rollup": "^0.50.0",
111111
"rollup-plugin-alias": "^1.3.1",
112-
"rollup-plugin-babel": "^2.7.1",
113-
"rollup-plugin-buble": "^0.15.0",
112+
"rollup-plugin-babel": "^3.0.2",
113+
"rollup-plugin-buble": "^0.16.0",
114114
"rollup-plugin-commonjs": "^8.0.2",
115115
"rollup-plugin-flow-no-whitespace": "^1.0.0",
116116
"rollup-plugin-node-resolve": "^3.0.0",
117-
"rollup-plugin-replace": "^1.1.1",
117+
"rollup-plugin-replace": "^2.0.0",
118118
"rollup-watch": "^4.0.0",
119119
"selenium-server": "^2.53.1",
120120
"serialize-javascript": "^1.3.0",

0 commit comments

Comments
 (0)