File tree Expand file tree Collapse file tree 2 files changed +11
-12
lines changed Expand file tree Collapse file tree 2 files changed +11
-12
lines changed Original file line number Diff line number Diff line change @@ -113,12 +113,6 @@ class ServeCommand {
113
113
return ;
114
114
}
115
115
116
- if ( ( compiler . options as WebpackDevServerOptions ) . devServer === undefined ) {
117
- await cli . runWebpack ( webpackCLIOptions as any , false ) ;
118
-
119
- return ;
120
- }
121
-
122
116
const servers : ( typeof DevServer ) [ ] = [ ] ;
123
117
124
118
if ( cli . needWatchStdin ( compiler ) ) {
@@ -156,6 +150,12 @@ class ServeCommand {
156
150
const usedPorts : number [ ] = [ ] ;
157
151
158
152
for ( const compilerForDevServer of compilersForDevServer ) {
153
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
154
+ // @ts -ignore
155
+ if ( compilerForDevServer . options . devServer === false ) {
156
+ continue ;
157
+ }
158
+
159
159
// eslint-disable-next-line @typescript-eslint/no-explicit-any
160
160
const args = devServerFlags . reduce ( ( accumulator : Record < string , any > , flag : any ) => {
161
161
accumulator [ flag . name ] = flag ;
@@ -244,6 +244,11 @@ class ServeCommand {
244
244
process . exit ( 2 ) ;
245
245
}
246
246
}
247
+
248
+ if ( servers . length === 0 ) {
249
+ cli . logger . error ( "No dev server configurations to run" ) ;
250
+ process . exit ( 2 ) ;
251
+ }
247
252
} ,
248
253
) ;
249
254
}
Original file line number Diff line number Diff line change @@ -2351,12 +2351,6 @@ class WebpackCLI implements IWebpackCLI {
2351
2351
isMultiCompiler : Array . isArray ( config . options ) ,
2352
2352
} ) ,
2353
2353
) ;
2354
-
2355
- // Handle when `devServer` is false
2356
- // TODO improve type on the webpack side
2357
- if ( ( item as any ) . devServer === false ) {
2358
- delete item . devServer ;
2359
- }
2360
2354
} ;
2361
2355
2362
2356
if ( Array . isArray ( config . options ) ) {
You can’t perform that action at this time.
0 commit comments