File tree Expand file tree Collapse file tree 2 files changed +14
-5
lines changed
packages/react-scripts/config Expand file tree Collapse file tree 2 files changed +14
-5
lines changed Original file line number Diff line number Diff line change 1+ var ExtractTextPlugin = require ( 'extract-text-webpack-plugin' ) ;
2+
13module . exports = {
24 'BABEL_STAGE_0' : {
35 toArray : 'presets' ,
4- get : function ( ) {
6+ getDev : function ( ) {
57 return require . resolve ( 'babel-preset-stage-0' )
68 }
79 } ,
810 'DECORATORS' : {
911 toArray : 'babelPlugins' ,
10- get : function ( ) {
12+ getDev : function ( ) {
1113 return require . resolve ( 'babel-plugin-transform-decorators-legacy' )
1214 }
1315 } ,
1416 'SASS' : {
1517 toArray : 'loaders' ,
16- get : function ( ) {
18+ getDev : function ( ) {
1719 return {
1820 test : / \. s c s s $ / ,
1921 loader : "style!css!postcss!sass"
2022 }
23+ } ,
24+ getProd : function ( ) {
25+ return {
26+ test : / \. s c s s $ / ,
27+ loader : ExtractTextPlugin . extract ( 'style' , 'css!postcss!sass' )
28+ }
2129 }
2230 } ,
2331 'LESS' : {
2432 toArray : 'loaders' ,
25- get : function ( ) {
33+ getDev : function ( ) {
2634 return {
2735 test : / \. l e s s $ / ,
2836 loader : "style!css!postcss!less"
Original file line number Diff line number Diff line change @@ -14,7 +14,8 @@ function getCustomConfig(prod) {
1414 var envValue = process . env [ 'REACT_APP_' + customizerKey ] ;
1515 if ( env && envValue && envValue !== 'false' ) {
1616 if ( customizer . toArray ) {
17- finalConfig [ customizer . toArray ] . push ( customizer . get ( ) ) ;
17+ var getCustomizer = ( prod ? customizer . getProd : customizer . getDev ) || customizer . getDev ;
18+ finalConfig [ customizer . toArray ] . push ( getCustomizer ( ) ) ;
1819 }
1920 finalConfig . values [ customizerKey ] = customizer . config || true ;
2021 }
You can’t perform that action at this time.
0 commit comments