File tree Expand file tree Collapse file tree 4 files changed +32
-24
lines changed Expand file tree Collapse file tree 4 files changed +32
-24
lines changed Original file line number Diff line number Diff line change @@ -26,22 +26,22 @@ function build (builds) {
2626 next ( )
2727}
2828
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 ) )
3333 . then ( ( { code } ) => {
3434 if ( isProd ) {
35- var minified = ( config . banner ? config . banner + '\n' : '' ) + uglify . minify ( code , {
35+ var minified = ( output . banner ? output . banner + '\n' : '' ) + uglify . minify ( code , {
3636 output : {
3737 /* eslint-disable camelcase */
3838 ascii_only : true
3939 /* eslint-enable camelcase */
4040 }
4141 } ) . code
42- return write ( config . file , minified , true )
42+ return write ( output . file , minified , true )
4343 } else {
44- return write ( config . file , code )
44+ return write ( output . file , code )
4545 }
4646 } )
4747}
Original file line number Diff line number Diff line change @@ -38,21 +38,25 @@ const configs = {
3838
3939function genConfig ( opts ) {
4040 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+ }
5256 }
5357
5458 if ( opts . env ) {
55- config . plugins . unshift ( replace ( {
59+ config . input . plugins . unshift ( replace ( {
5660 'process.env.NODE_ENV' : JSON . stringify ( opts . env )
5761 } ) )
5862 }
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 11const buble = require ( 'rollup-plugin-buble' )
22
33module . 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+ } ,
810 plugins : [ buble ( ) ]
911}
You can’t perform that action at this time.
0 commit comments