File tree 4 files changed +32
-24
lines changed
4 files changed +32
-24
lines changed Original file line number Diff line number Diff line change @@ -26,22 +26,22 @@ function build (builds) {
26
26
next ( )
27
27
}
28
28
29
- function buildEntry ( config ) {
30
- const isProd = / m i n \. j s $ / . test ( config . file )
31
- return rollup . rollup ( config )
32
- . then ( bundle => bundle . generate ( config ) )
29
+ function buildEntry ( { input , output } ) {
30
+ const isProd = / m i n \. j s $ / . test ( output . file )
31
+ return rollup . rollup ( input )
32
+ . then ( bundle => bundle . generate ( output ) )
33
33
. then ( ( { code } ) => {
34
34
if ( isProd ) {
35
- var minified = ( config . banner ? config . banner + '\n' : '' ) + uglify . minify ( code , {
35
+ var minified = ( output . banner ? output . banner + '\n' : '' ) + uglify . minify ( code , {
36
36
output : {
37
37
/* eslint-disable camelcase */
38
38
ascii_only : true
39
39
/* eslint-enable camelcase */
40
40
}
41
41
} ) . code
42
- return write ( config . file , minified , true )
42
+ return write ( output . file , minified , true )
43
43
} else {
44
- return write ( config . file , code )
44
+ return write ( output . file , code )
45
45
}
46
46
} )
47
47
}
Original file line number Diff line number Diff line change @@ -38,21 +38,25 @@ const configs = {
38
38
39
39
function genConfig ( opts ) {
40
40
const config = {
41
- input : opts . input ,
42
- file : opts . file ,
43
- format : opts . format ,
44
- banner,
45
- name : 'Vuex' ,
46
- plugins : [
47
- replace ( {
48
- __VERSION__ : version
49
- } ) ,
50
- buble ( )
51
- ]
41
+ input : {
42
+ input : opts . input ,
43
+ plugins : [
44
+ replace ( {
45
+ __VERSION__ : version
46
+ } ) ,
47
+ buble ( )
48
+ ]
49
+ } ,
50
+ output : {
51
+ banner,
52
+ file : opts . file ,
53
+ format : opts . format ,
54
+ name : 'Vuex'
55
+ }
52
56
}
53
57
54
58
if ( opts . env ) {
55
- config . plugins . unshift ( replace ( {
59
+ config . input . plugins . unshift ( replace ( {
56
60
'process.env.NODE_ENV' : JSON . stringify ( opts . env )
57
61
} ) )
58
62
}
Original file line number Diff line number Diff line change 1
- module . exports = require ( './configs' ) . commonjs
1
+ const { input, output } = require ( './configs' ) . commonjs
2
+
3
+ module . exports = Object . assign ( { } , input , { output } )
Original file line number Diff line number Diff line change 1
1
const buble = require ( 'rollup-plugin-buble' )
2
2
3
3
module . exports = {
4
- entry : 'src/plugins/logger.js' ,
5
- dest : 'dist/logger.js' ,
6
- format : 'umd' ,
7
- moduleName : 'createVuexLogger' ,
4
+ input : 'src/plugins/logger.js' ,
5
+ output : {
6
+ file : 'dist/logger.js' ,
7
+ format : 'umd' ,
8
+ name : 'createVuexLogger' ,
9
+ } ,
8
10
plugins : [ buble ( ) ]
9
11
}
You can’t perform that action at this time.
0 commit comments