@@ -122,11 +122,6 @@ class WebpackCLI {
122122 if ( option . configs ) {
123123 let needNegativeOption = false ;
124124 let mainOptionType = new Set ( ) ;
125- let isBuiltInFlag = false ;
126-
127- if ( this . builtInFlags ) {
128- isBuiltInFlag = this . builtInFlags . map ( ( { name } ) => name ) . includes ( option . name ) ;
129- }
130125
131126 option . configs . forEach ( ( config ) => {
132127 // Possible value: "enum" | "string" | "path" | "number" | "boolean" | "RegExp" | "reset"
@@ -135,14 +130,8 @@ class WebpackCLI {
135130 mainOptionType . add ( Boolean ) ;
136131 break ;
137132 case 'boolean' :
138- if ( isBuiltInFlag ) {
139- if ( option . negative ) {
140- needNegativeOption = true ;
141- }
142- } else {
143- if ( ! needNegativeOption ) {
144- needNegativeOption = true ;
145- }
133+ if ( ! needNegativeOption ) {
134+ needNegativeOption = true ;
146135 }
147136
148137 mainOptionType . add ( Boolean ) ;
@@ -374,7 +363,8 @@ class WebpackCLI {
374363 alias : 'm' ,
375364 configs : [
376365 {
377- type : 'boolean' ,
366+ type : 'enum' ,
367+ values : [ true ] ,
378368 } ,
379369 ] ,
380370 description : "Merge two or more configurations using 'webpack-merge'." ,
@@ -441,7 +431,8 @@ class WebpackCLI {
441431 name : 'analyze' ,
442432 configs : [
443433 {
444- type : 'boolean' ,
434+ type : 'enum' ,
435+ values : [ true ] ,
445436 } ,
446437 ] ,
447438 multiple : false ,
@@ -454,7 +445,8 @@ class WebpackCLI {
454445 type : 'string' ,
455446 } ,
456447 {
457- type : 'boolean' ,
448+ type : 'enum' ,
449+ values : [ true ] ,
458450 } ,
459451 ] ,
460452 description : 'Print compilation progress during build.' ,
@@ -477,7 +469,8 @@ class WebpackCLI {
477469 type : 'string' ,
478470 } ,
479471 {
480- type : 'boolean' ,
472+ type : 'enum' ,
473+ values : [ true ] ,
481474 } ,
482475 ] ,
483476 alias : 'j' ,
@@ -609,7 +602,7 @@ class WebpackCLI {
609602 } ) ;
610603
611604 this . builtInOptionsCache = options ;
612- this . builtInFlags = builtInFlags ;
605+
613606 return options ;
614607 }
615608
0 commit comments