Skip to content

Commit 2af0801

Browse files
feat: allow to pass parseOption to CLI class (#2299)
1 parent efe81e9 commit 2af0801

File tree

2 files changed

+5
-11
lines changed

2 files changed

+5
-11
lines changed

packages/webpack-cli/lib/index.js

+3-9
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,7 @@
1-
const WebpackCLI = require('./webpack-cli');
2-
const { commands } = require('./utils/cli-flags');
1+
const CLI = require('./webpack-cli');
32
const logger = require('./utils/logger');
43
const getPackageManager = require('./utils/get-package-manager');
54

6-
module.exports = WebpackCLI;
7-
5+
module.exports = CLI;
86
// export additional utils used by other packages
9-
module.exports.utils = {
10-
logger,
11-
commands,
12-
getPackageManager,
13-
};
7+
module.exports.utils = { logger, getPackageManager };

packages/webpack-cli/lib/webpack-cli.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ class WebpackCLI {
227227
return flags;
228228
}
229229

230-
async run(args) {
230+
async run(args, parseOptions) {
231231
// Built-in internal commands
232232
const bundleCommandOptions = {
233233
name: 'bundle',
@@ -712,7 +712,7 @@ class WebpackCLI {
712712
await this.program.parseAsync([commandName, ...options], { from: 'user' });
713713
});
714714

715-
await this.program.parseAsync(args);
715+
await this.program.parseAsync(args, parseOptions);
716716
}
717717

718718
async resolveConfig(options) {

0 commit comments

Comments
 (0)