File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -588,14 +588,17 @@ class WebpackBaseBuilder extends Config {
588588
589589 createBabelLoader ( ) {
590590 const loaderName = 'babel-loader' ;
591+ const options = { forceEnv : process . env . BABEL_ENV } ;
591592 const compile = this . config . compile || { } ;
592- const config = compile . cache ? this . createCacheLoader ( compile . cache , loaderName ) : { loader : loaderName , options : { } } ;
593+ const configCacheOptions = this . utils . isObject ( compile . cache ) ? compile . cache : { } ;
594+ const cacheOptions = this . merge ( options , configCacheOptions ) ;
595+ const config = compile . cache ? this . createCacheLoader ( cacheOptions , loaderName ) : { loader : loaderName , options } ;
593596 // use project .babelrc
594597 if ( fs . existsSync ( this . projectBabelrc ) ) {
595598 return config ;
596599 }
597600 // use default babelrc
598- return this . merge ( config , { options : this . babelConfig } ) ;
601+ return this . merge ( config , this . merge ( options , this . babelConfig ) ) ;
599602 }
600603
601604 createCacheLoader ( loaderOptions , name ) {
Original file line number Diff line number Diff line change 11{
22 "name" : " easywebpack" ,
3- "version" : " 4.9.0-rc.3 " ,
3+ "version" : " 4.9.0-rc.4 " ,
44 "description" : " 基于 Webpack 的前端构建工程化解决方案" ,
55 "keywords" : [
66 " webpack" ,
You can’t perform that action at this time.
0 commit comments