@@ -68,8 +68,7 @@ const builds = {
68
68
alias : { he : './entity-decoder' } ,
69
69
banner
70
70
} ,
71
- // Runtime only (ES Modules). Used by bundlers that support ES Modules,
72
- // e.g. Rollup & Webpack 2
71
+ // Runtime only ES modules build (for bundlers)
73
72
'web-runtime-esm' : {
74
73
entry : resolve ( 'web/entry-runtime.js' ) ,
75
74
dest : resolve ( 'dist/vue.runtime.esm.js' ) ,
@@ -220,11 +219,6 @@ function genConfig (name) {
220
219
input : opts . entry ,
221
220
external : opts . external ,
222
221
plugins : [
223
- replace ( {
224
- __WEEX__ : ! ! opts . weex ,
225
- __WEEX_VERSION__ : weexVersion ,
226
- __VERSION__ : version
227
- } ) ,
228
222
flow ( ) ,
229
223
alias ( Object . assign ( { } , aliases , opts . alias ) )
230
224
] . concat ( opts . plugins || [ ] ) ,
@@ -241,15 +235,21 @@ function genConfig (name) {
241
235
}
242
236
}
243
237
238
+ // built-in vars
239
+ const vars = {
240
+ __WEEX__ : ! ! opts . weex ,
241
+ __WEEX_VERSION__ : weexVersion ,
242
+ __VERSION__ : version
243
+ }
244
+ // feature flags
245
+ Object . keys ( featureFlags ) . forEach ( key => {
246
+ vars [ `process.env.${ key } ` ] = featureFlags [ key ]
247
+ } )
248
+ // build-specific env
244
249
if ( opts . env ) {
245
- const vars = {
246
- 'process.env.NODE_ENV' : JSON . stringify ( opts . env )
247
- }
248
- Object . keys ( featureFlags ) . forEach ( key => {
249
- vars [ `process.env.${ key } ` ] = featureFlags [ key ]
250
- } )
251
- config . plugins . push ( replace ( vars ) )
250
+ vars [ 'process.env.NODE_ENV' ] = JSON . stringify ( opts . env )
252
251
}
252
+ config . plugins . push ( replace ( vars ) )
253
253
254
254
if ( opts . transpile !== false ) {
255
255
config . plugins . push ( buble ( ) )
0 commit comments