@@ -2237,6 +2237,10 @@ class WebpackCLI implements IWebpackCLI {
22372237 }
22382238
22392239 // Output warnings
2240+ if ( ! Object . isExtensible ( item ) ) {
2241+ return ;
2242+ }
2243+
22402244 if (
22412245 options . isWatchingLikeCommand &&
22422246 options . argv &&
@@ -2263,7 +2267,7 @@ class WebpackCLI implements IWebpackCLI {
22632267 } ;
22642268
22652269 // Setup default cache options
2266- if ( isFileSystemCacheOptions ( item ) ) {
2270+ if ( isFileSystemCacheOptions ( item ) && Object . isExtensible ( item . cache ) ) {
22672271 const configPath = config . path . get ( item ) ;
22682272
22692273 if ( configPath ) {
@@ -2321,22 +2325,26 @@ class WebpackCLI implements IWebpackCLI {
23212325 colors = Boolean ( this . colors . isColorSupported ) ;
23222326 }
23232327
2324- item . stats . colors = colors ;
2328+ if ( Object . isExtensible ( item . stats ) ) {
2329+ item . stats . colors = colors ;
2330+ }
23252331
23262332 // Apply CLI plugin
23272333 if ( ! item . plugins ) {
23282334 item . plugins = [ ] ;
23292335 }
23302336
2331- item . plugins . unshift (
2332- new CLIPlugin ( {
2333- configPath : config . path . get ( item ) ,
2334- helpfulOutput : ! options . json ,
2335- progress : options . progress ,
2336- analyze : options . analyze ,
2337- isMultiCompiler : Array . isArray ( config . options ) ,
2338- } ) ,
2339- ) ;
2337+ if ( Object . isExtensible ( item . plugins ) ) {
2338+ item . plugins . unshift (
2339+ new CLIPlugin ( {
2340+ configPath : config . path . get ( item ) ,
2341+ helpfulOutput : ! options . json ,
2342+ progress : options . progress ,
2343+ analyze : options . analyze ,
2344+ isMultiCompiler : Array . isArray ( config . options ) ,
2345+ } ) ,
2346+ ) ;
2347+ }
23402348 } ;
23412349
23422350 if ( Array . isArray ( config . options ) ) {
0 commit comments