Skip to content

Commit

Permalink
fix: broken serve with new CLI API (#2770)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexander-akait committed Jun 7, 2021
1 parent 060268b commit 2d7ab35
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/serve/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class ServeCommand {
let options = {};

if (isNewDevServerCLIAPI) {
if (typeof webpack.cli.getArguments === "function") {
if (webpack.cli && typeof webpack.cli.getArguments === "function") {
options = webpack.cli.getArguments(devServer.schema);
} else {
options = devServer.cli.getArguments();
Expand Down Expand Up @@ -176,7 +176,7 @@ class ServeCommand {
}, {});
const result = Object.assign({}, compiler.options.devServer);
const problems = (
typeof webpack.cli.processArguments === "function"
webpack.cli && typeof webpack.cli.processArguments === "function"
? webpack.cli
: devServer.cli
).processArguments(args, result, values);
Expand Down

0 comments on commit 2d7ab35

Please sign in to comment.