Skip to content

Commit 1841c58

Browse files
authored
refactor: avoid unnecessary arguments to methods (#3616)
1 parent 78594da commit 1841c58

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

lib/Server.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -135,13 +135,15 @@ class Server {
135135
}
136136

137137
// eslint-disable-next-line class-methods-use-this
138-
async normalizeOptions(options) {
138+
async normalizeOptions() {
139+
const { options } = this;
140+
139141
if (!this.logger) {
140142
this.logger = this.compiler.getInfrastructureLogger("webpack-dev-server");
141143
}
142144

143145
// TODO: improve this to not use .find for compiler watchOptions
144-
const configArray = this.getCompilerConfigArray(this.compiler);
146+
const configArray = this.getCompilerConfigArray();
145147
const watchOptionsConfig = configArray.find(
146148
(config) => config.watch !== false && config.watchOptions
147149
);
@@ -1438,7 +1440,7 @@ class Server {
14381440
getStats(statsObj) {
14391441
const stats = Server.DEFAULT_STATS;
14401442

1441-
const configArray = this.getCompilerConfigArray(this.compiler);
1443+
const configArray = this.getCompilerConfigArray();
14421444
const statsOption = this.getStatsOption(configArray);
14431445

14441446
if (typeof statsOption === "object" && statsOption.warningsFilter) {
@@ -1669,7 +1671,7 @@ class Server {
16691671
}
16701672

16711673
async start() {
1672-
await this.normalizeOptions(this.options);
1674+
await this.normalizeOptions();
16731675

16741676
if (this.options.ipc) {
16751677
await new Promise((resolve, reject) => {

0 commit comments

Comments
 (0)