@@ -12,12 +12,45 @@ const banner = `/*!
12
12
*/`
13
13
14
14
const 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
+ }
21
54
]
22
55
23
56
function createEntries ( ) {
@@ -37,6 +70,7 @@ function createEntry(config) {
37
70
banner,
38
71
file : config . file ,
39
72
format : config . format ,
73
+ exports : 'auto' ,
40
74
globals : {
41
75
vue : 'Vue'
42
76
}
@@ -56,19 +90,25 @@ function createEntry(config) {
56
90
c . external . push ( '@vue/devtools-api' )
57
91
}
58
92
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
+ )
69
105
70
106
if ( config . transpile !== false ) {
71
- c . plugins . push ( buble ( ) )
107
+ c . plugins . push (
108
+ buble ( {
109
+ transforms : { asyncAwait : false , forOf : false }
110
+ } )
111
+ )
72
112
}
73
113
74
114
c . plugins . push ( resolve ( ) )
0 commit comments