File tree Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change 99export default function getDevServerOptions ( compiler ) : any {
1010 let devServerOptions ;
1111 if ( compiler . compilers ) {
12+ // devServer options could be found in any of the compilers,
13+ // so simply find the first instance and use it, if there is one
1214 const comp = compiler . compilers . find ( ( comp ) => comp . options . devServer ) ;
1315 if ( comp ) {
1416 devServerOptions = comp . options . devServer ;
Original file line number Diff line number Diff line change 99export default function mergeOptions ( cliOptions , devServerOptions ) : any {
1010 // CLI options should take precedence over devServer options,
1111 // and CLI options should have no default values included
12- return { ...devServerOptions , ...cliOptions } ;
12+ const options = { ...devServerOptions , ...cliOptions } ;
13+
14+ if ( devServerOptions . client && cliOptions . client ) {
15+ // the user could set some client options in their devServer config,
16+ // then also specify client options on the CLI
17+ options . client = { ...devServerOptions . client , ...cliOptions . client } ;
18+ }
19+
20+ return options ;
1321}
You can’t perform that action at this time.
0 commit comments