@@ -8,14 +8,16 @@ const path = require("path");
88
99const OptionsDefaulter = require ( "./OptionsDefaulter" ) ;
1010const Template = require ( "./Template" ) ;
11- const isProductionLikeMode = require ( "./util/mode" ) ;
11+
12+ const isProductionLikeMode = options => {
13+ return options . mode === "production" || ! options . mode ;
14+ } ;
1215
1316class WebpackOptionsDefaulter extends OptionsDefaulter {
1417 constructor ( ) {
1518 super ( ) ;
1619
1720 this . set ( "entry" , "./src" ) ;
18- this . set ( "mode" , "defaultedProduction" ) ;
1921
2022 this . set ( "devtool" , "make" , options => ( options . mode === "development" ? "eval" : false ) ) ;
2123 this . set ( "cache" , "make" , options => options . mode === "development" ) ;
@@ -140,7 +142,7 @@ class WebpackOptionsDefaulter extends OptionsDefaulter {
140142 this . set ( "node.__filename" , "mock" ) ;
141143 this . set ( "node.__dirname" , "mock" ) ;
142144
143- this . set ( "performance" , "make" , options => ( options . mode !== "production" ? false : undefined ) ) ;
145+ this . set ( "performance" , "make" , options => ( isProductionLikeMode ( options ) ? false : undefined ) ) ;
144146 this . set ( "performance" , "call" , value => {
145147 if ( typeof value === "boolean" ) {
146148 return value ;
0 commit comments