Skip to content

Commit b0466b7

Browse files
committed
refactor: code
1 parent d28f6af commit b0466b7

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

lib/Server.js

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,15 @@ class Server {
2020
constructor(options = {}, compiler) {
2121
// TODO: remove this after plugin support is published
2222

23-
const showDeprecationWarning = util.deprecate(
24-
() => {},
25-
"Using 'compiler' as the first argument is deprecated. Please use 'options' as the first argument and 'compiler' as the second argument.",
26-
"DEP_WEBPACK_DEV_SERVER_API"
27-
);
28-
2923
if (options.hooks) {
24+
const showDeprecationWarning = util.deprecate(
25+
() => {},
26+
"Using 'compiler' as the first argument is deprecated. Please use 'options' as the first argument and 'compiler' as the second argument.",
27+
"DEP_WEBPACK_DEV_SERVER_API"
28+
);
29+
3030
showDeprecationWarning();
31+
3132
[options, compiler] = [compiler, options];
3233
}
3334

0 commit comments

Comments
 (0)