@@ -12,12 +12,45 @@ const banner = `/*!
1212 */`
1313
1414const configs = [
15- { input : 'src/index.js' , file : 'dist/vuex.esm-browser.js' , format : 'es' , browser : true , env : 'development' } ,
16- { input : 'src/index.js' , file : 'dist/vuex.esm-browser.prod.js' , format : 'es' , browser : true , env : 'production' } ,
17- { input : 'src/index.js' , file : 'dist/vuex.esm-bundler.js' , format : 'es' , env : 'development' } ,
18- { input : 'src/index.cjs.js' , file : 'dist/vuex.global.js' , format : 'iife' , env : 'development' } ,
19- { input : 'src/index.cjs.js' , file : 'dist/vuex.global.prod.js' , format : 'iife' , minify : true , env : 'production' } ,
20- { input : 'src/index.cjs.js' , file : 'dist/vuex.cjs.js' , format : 'cjs' , env : 'development' }
15+ {
16+ input : 'src/index.js' ,
17+ file : 'dist/vuex.esm-browser.js' ,
18+ format : 'es' ,
19+ browser : true ,
20+ env : 'development'
21+ } ,
22+ {
23+ input : 'src/index.js' ,
24+ file : 'dist/vuex.esm-browser.prod.js' ,
25+ format : 'es' ,
26+ browser : true ,
27+ env : 'production'
28+ } ,
29+ {
30+ input : 'src/index.js' ,
31+ file : 'dist/vuex.esm-bundler.js' ,
32+ format : 'es' ,
33+ env : 'development'
34+ } ,
35+ {
36+ input : 'src/index.cjs.js' ,
37+ file : 'dist/vuex.global.js' ,
38+ format : 'iife' ,
39+ env : 'development'
40+ } ,
41+ {
42+ input : 'src/index.cjs.js' ,
43+ file : 'dist/vuex.global.prod.js' ,
44+ format : 'iife' ,
45+ minify : true ,
46+ env : 'production'
47+ } ,
48+ {
49+ input : 'src/index.cjs.js' ,
50+ file : 'dist/vuex.cjs.js' ,
51+ format : 'cjs' ,
52+ env : 'development'
53+ }
2154]
2255
2356function createEntries ( ) {
@@ -37,6 +70,7 @@ function createEntry(config) {
3770 banner,
3871 file : config . file ,
3972 format : config . format ,
73+ exports : 'auto' ,
4074 globals : {
4175 vue : 'Vue'
4276 }
@@ -56,19 +90,25 @@ function createEntry(config) {
5690 c . external . push ( '@vue/devtools-api' )
5791 }
5892
59- c . plugins . push ( replace ( {
60- preventAssignment : true ,
61- __VERSION__ : pkg . version ,
62- __DEV__ : isBundlerBuild
63- ? `(process.env.NODE_ENV !== 'production')`
64- : config . env !== 'production' ,
65- __VUE_PROD_DEVTOOLS__ : isBundlerESMBuild
66- ? '__VUE_PROD_DEVTOOLS__'
67- : 'false'
68- } ) )
93+ c . plugins . push (
94+ replace ( {
95+ preventAssignment : true ,
96+ __VERSION__ : pkg . version ,
97+ __DEV__ : isBundlerBuild
98+ ? `(process.env.NODE_ENV !== 'production')`
99+ : config . env !== 'production' ,
100+ __VUE_PROD_DEVTOOLS__ : isBundlerESMBuild
101+ ? '__VUE_PROD_DEVTOOLS__'
102+ : 'false'
103+ } )
104+ )
69105
70106 if ( config . transpile !== false ) {
71- c . plugins . push ( buble ( ) )
107+ c . plugins . push (
108+ buble ( {
109+ transforms : { asyncAwait : false , forOf : false }
110+ } )
111+ )
72112 }
73113
74114 c . plugins . push ( resolve ( ) )
0 commit comments