File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -20,6 +20,13 @@ class Server {
20
20
// TODO: remove this after plugin support is published
21
21
if ( options . hooks ) {
22
22
[ options , compiler ] = [ compiler , options ] ;
23
+
24
+ this . compiler = compiler ;
25
+ this . logger = this . compiler . getInfrastructureLogger ( "webpack-dev-server" ) ;
26
+
27
+ this . logger . warn (
28
+ "Using 'compiler' as the first argument is deprecated. Please use 'options' as first argument and 'compiler' as second argument."
29
+ ) ;
23
30
}
24
31
25
32
validate ( schema , options , "webpack Dev Server" ) ;
@@ -29,7 +36,10 @@ class Server {
29
36
// Keep track of websocket proxies for external websocket upgrade.
30
37
this . webSocketProxies = [ ] ;
31
38
32
- this . compiler = compiler ;
39
+ if ( typeof this . compiler === "undefined" ) {
40
+ this . compiler = compiler ;
41
+ this . logger = this . compiler . getInfrastructureLogger ( "webpack-dev-server" ) ;
42
+ }
33
43
}
34
44
35
45
static get DEFAULT_STATS ( ) {
@@ -1378,7 +1388,6 @@ class Server {
1378
1388
}
1379
1389
1380
1390
listen ( port , hostname , fn ) {
1381
- this . logger = this . compiler . getInfrastructureLogger ( "webpack-dev-server" ) ;
1382
1391
this . normalizeOptions ( this . options ) ;
1383
1392
1384
1393
if ( typeof port === "function" ) {
You can’t perform that action at this time.
0 commit comments