Skip to content

Commit 2d7ab35

Browse files
fix: broken serve with new CLI API (#2770)
1 parent 060268b commit 2d7ab35

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/serve/src/index.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class ServeCommand {
1414
let options = {};
1515

1616
if (isNewDevServerCLIAPI) {
17-
if (typeof webpack.cli.getArguments === "function") {
17+
if (webpack.cli && typeof webpack.cli.getArguments === "function") {
1818
options = webpack.cli.getArguments(devServer.schema);
1919
} else {
2020
options = devServer.cli.getArguments();
@@ -176,7 +176,7 @@ class ServeCommand {
176176
}, {});
177177
const result = Object.assign({}, compiler.options.devServer);
178178
const problems = (
179-
typeof webpack.cli.processArguments === "function"
179+
webpack.cli && typeof webpack.cli.processArguments === "function"
180180
? webpack.cli
181181
: devServer.cli
182182
).processArguments(args, result, values);

0 commit comments

Comments
 (0)