Skip to content

Commit 6d5ce11

Browse files
fix: rebase
1 parent 823420b commit 6d5ce11

File tree

1 file changed

+3
-85
lines changed

1 file changed

+3
-85
lines changed

lib/Server.js

Lines changed: 3 additions & 85 deletions
Original file line numberDiff line numberDiff line change
@@ -170,13 +170,13 @@ class Server {
170170
}
171171

172172
// eslint-disable-next-line class-methods-use-this
173-
normalizeOptions() {
173+
async normalizeOptions() {
174174
const { options } = this;
175175

176176
if (!this.logger) {
177177
this.logger = this.compiler.getInfrastructureLogger("webpack-dev-server");
178178
}
179-
179+
180180
const compilerOptions = this.getCompilerOptions();
181181
// TODO remove `{}` after drop webpack v4 support
182182
const watchOptions = compilerOptions.watchOptions || {};
@@ -528,7 +528,7 @@ class Server {
528528

529529
return level;
530530
};
531-
531+
532532
if (typeof proxyOptions.logLevel === "undefined") {
533533
proxyOptions.logLevel = getLogLevelForProxy(
534534
compilerOptions.infrastructureLogging
@@ -1581,28 +1581,6 @@ class Server {
15811581
});
15821582
}
15831583

1584-
close(callback) {
1585-
if (this.webSocketServer) {
1586-
this.webSocketServer.implementation.close();
1587-
}
1588-
1589-
const prom = Promise.all(
1590-
this.staticWatchers.map((watcher) => watcher.close())
1591-
);
1592-
this.staticWatchers = [];
1593-
1594-
if (this.server) {
1595-
this.server.kill(() => {
1596-
// watchers must be closed before closing middleware
1597-
prom.then(() => {
1598-
this.middleware.close(callback);
1599-
});
1600-
});
1601-
} else if (callback) {
1602-
callback();
1603-
}
1604-
}
1605-
16061584
getStats(statsObj) {
16071585
const stats = Server.DEFAULT_STATS;
16081586
const compilerOptions = this.getCompilerOptions();
@@ -1942,66 +1920,6 @@ class Server {
19421920
this.stop().then(() => callback(null), callback);
19431921
}
19441922

1945-
// TODO remove in the next major release
1946-
listen(port, hostname, fn) {
1947-
util.deprecate(
1948-
() => {},
1949-
"'listen' is deprecated. Please use async 'start' or 'startCallback' methods.",
1950-
"DEP_WEBPACK_DEV_SERVER_LISTEN"
1951-
)();
1952-
1953-
this.logger = this.compiler.getInfrastructureLogger("webpack-dev-server");
1954-
1955-
if (typeof port === "function") {
1956-
fn = port;
1957-
}
1958-
1959-
if (
1960-
typeof port !== "undefined" &&
1961-
typeof this.options.port !== "undefined" &&
1962-
port !== this.options.port
1963-
) {
1964-
this.options.port = port;
1965-
1966-
this.logger.warn(
1967-
'The "port" specified in options is different from the port passed as an argument. Will be used from arguments.'
1968-
);
1969-
}
1970-
1971-
if (!this.options.port) {
1972-
this.options.port = port;
1973-
}
1974-
1975-
if (
1976-
typeof hostname !== "undefined" &&
1977-
typeof this.options.host !== "undefined" &&
1978-
hostname !== this.options.host
1979-
) {
1980-
this.options.host = hostname;
1981-
1982-
this.logger.warn(
1983-
'The "host" specified in options is different from the host passed as an argument. Will be used from arguments.'
1984-
);
1985-
}
1986-
1987-
if (!this.options.host) {
1988-
this.options.host = hostname;
1989-
}
1990-
1991-
return this.start()
1992-
.then(() => {
1993-
if (fn) {
1994-
fn.call(this.server);
1995-
}
1996-
})
1997-
.catch((error) => {
1998-
// Nothing
1999-
if (fn) {
2000-
fn.call(this.server, error);
2001-
}
2002-
});
2003-
}
2004-
20051923
// TODO remove in the next major release
20061924
close(callback) {
20071925
util.deprecate(

0 commit comments

Comments
 (0)