Skip to content

Commit 8aa1b7d

Browse files
knagaitsevematipico
authored andcommitted
fix(serve): handle serve args as an array (#1174)
* fix(serve): add serve as an external package * fix(serve): handle args on an array basis
1 parent 9222016 commit 8aa1b7d

File tree

4 files changed

+5998
-1519
lines changed

4 files changed

+5998
-1519
lines changed

lib/webpack-cli.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ const defaultCommands = {
1212
plugin: 'generate-plugin',
1313
info: 'info',
1414
migrate: 'migrate',
15+
serve: 'serve',
1516
};
1617

1718
class WebpackCLI extends GroupHelper {

packages/serve/index.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@ import { core } from "../../lib/utils/cli-flags";
1212
* @param {String[]} args - args processed from the CLI
1313
* @returns {Function} invokes the devServer API
1414
*/
15-
export default function serve(args): void {
16-
process.argv = process.argv.filter(arg => arg !== 'serve');
15+
export default function serve(...args): void {
1716
const cli = new WebpackCLI();
1817
// partial parsing usage: https://github.com/75lb/command-line-args/wiki/Partial-parsing
1918

0 commit comments

Comments
 (0)