File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1936,33 +1936,16 @@ class WebpackCLI implements IWebpackCLI {
19361936 config . options = [ ] ;
19371937
19381938 loadedConfigs . forEach ( ( loadedConfig ) => {
1939- // TODO we should run webpack multiple times when the `--config` options have multiple values with `--merge`, need to solve for the next major release
1940- if ( ( config . options as LoadableWebpackConfiguration [ ] ) . length === 0 ) {
1941- config . options = loadedConfig . options as WebpackConfiguration ;
1942- } else {
1943- if ( ! Array . isArray ( config . options ) ) {
1944- config . options = [ config . options ] ;
1945- }
1946-
1947- if ( Array . isArray ( loadedConfig . options ) ) {
1948- for ( const item of loadedConfig . options ) {
1949- config . options . push ( item ) ;
1950- }
1951- } else {
1952- config . options . push ( loadedConfig . options as WebpackConfiguration ) ;
1953- }
1954- }
1955-
19561939 if ( Array . isArray ( loadedConfig . options ) ) {
1957- for ( const options of loadedConfig . options ) {
1940+ for ( const item of loadedConfig . options ) {
1941+ ( config . options as WebpackConfiguration [ ] ) . push ( item ) ;
19581942 config . path . set ( options , [ loadedConfig . path ] ) ;
19591943 }
19601944 } else {
1945+ ( config . options as WebpackConfiguration [ ] ) . push ( loadedConfig . options ) ;
19611946 config . path . set ( loadedConfig . options , [ loadedConfig . path ] ) ;
19621947 }
19631948 } ) ;
1964-
1965- config . options = config . options . length === 1 ? config . options [ 0 ] : config . options ;
19661949 } else {
19671950 // TODO ".mts" is not supported by `interpret`, need to add it
19681951 // Prioritize popular extensions first to avoid unnecessary fs calls
You can’t perform that action at this time.
0 commit comments