@@ -16,6 +16,7 @@ class WebpackOptionsDefaulter extends OptionsDefaulter {
1616 this . set ( "context" , process . cwd ( ) ) ;
1717 this . set ( "target" , "web" ) ;
1818
19+ this . set ( "module" , "call" , value => Object . assign ( { } , value ) ) ;
1920 this . set ( "module.unknownContextRequest" , "." ) ;
2021 this . set ( "module.unknownContextRegExp" , false ) ;
2122 this . set ( "module.unknownContextRecursive" , true ) ;
@@ -29,7 +30,6 @@ class WebpackOptionsDefaulter extends OptionsDefaulter {
2930 this . set ( "module.wrappedContextCritical" , false ) ;
3031 this . set ( "module.strictExportPresence" , false ) ;
3132 this . set ( "module.strictThisContextOnImports" , false ) ;
32-
3333 this . set ( "module.unsafeCache" , true ) ;
3434
3535 this . set ( "output" , "call" , ( value , options ) => {
@@ -40,7 +40,7 @@ class WebpackOptionsDefaulter extends OptionsDefaulter {
4040 } else if ( typeof value !== "object" ) {
4141 return { } ;
4242 } else {
43- return value ;
43+ return Object . assign ( { } , value ) ;
4444 }
4545 } ) ;
4646 this . set ( "output.filename" , "[name].js" ) ;
@@ -68,7 +68,13 @@ class WebpackOptionsDefaulter extends OptionsDefaulter {
6868 this . set ( "output.devtoolLineToLine" , false ) ;
6969 this . set ( "output.strictModuleExceptionHandling" , false ) ;
7070
71- this . set ( "node" , { } ) ;
71+ this . set ( "node" , "call" , value => {
72+ if ( typeof value === "boolean" ) {
73+ return value ;
74+ } else {
75+ return Object . assign ( { } , value ) ;
76+ }
77+ } ) ;
7278 this . set ( "node.console" , false ) ;
7379 this . set ( "node.process" , true ) ;
7480 this . set ( "node.global" , true ) ;
@@ -77,11 +83,18 @@ class WebpackOptionsDefaulter extends OptionsDefaulter {
7783 this . set ( "node.__filename" , "mock" ) ;
7884 this . set ( "node.__dirname" , "mock" ) ;
7985
86+ this . set ( "performance" , "call" , value => {
87+ if ( typeof value === "boolean" ) {
88+ return value ;
89+ } else {
90+ return Object . assign ( { } , value ) ;
91+ }
92+ } ) ;
8093 this . set ( "performance.maxAssetSize" , 250000 ) ;
8194 this . set ( "performance.maxEntrypointSize" , 250000 ) ;
8295 this . set ( "performance.hints" , false ) ;
8396
84- this . set ( "resolve" , { } ) ;
97+ this . set ( "resolve" , "call" , value => Object . assign ( { } , value ) ) ;
8598 this . set ( "resolve.unsafeCache" , true ) ;
8699 this . set ( "resolve.modules" , [ "node_modules" ] ) ;
87100 this . set ( "resolve.extensions" , [ ".js" , ".json" ] ) ;
@@ -101,7 +114,8 @@ class WebpackOptionsDefaulter extends OptionsDefaulter {
101114 this . set ( "resolve.cacheWithContext" , "make" , ( options ) => {
102115 return Array . isArray ( options . resolve . plugins ) && options . resolve . plugins . length > 0 ;
103116 } ) ;
104- this . set ( "resolveLoader" , { } ) ;
117+
118+ this . set ( "resolveLoader" , "call" , value => Object . assign ( { } , value ) ) ;
105119 this . set ( "resolveLoader.unsafeCache" , true ) ;
106120 this . set ( "resolveLoader.mainFields" , [ "loader" , "main" ] ) ;
107121 this . set ( "resolveLoader.extensions" , [ ".js" , ".json" ] ) ;
0 commit comments