Skip to content

Commit

Permalink
feat: allow to pass parseOption to CLI class (#2299)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexander-akait committed Jan 3, 2021
1 parent efe81e9 commit 2af0801
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 11 deletions.
12 changes: 3 additions & 9 deletions packages/webpack-cli/lib/index.js
@@ -1,13 +1,7 @@
const WebpackCLI = require('./webpack-cli');
const { commands } = require('./utils/cli-flags');
const CLI = require('./webpack-cli');
const logger = require('./utils/logger');
const getPackageManager = require('./utils/get-package-manager');

module.exports = WebpackCLI;

module.exports = CLI;
// export additional utils used by other packages
module.exports.utils = {
logger,
commands,
getPackageManager,
};
module.exports.utils = { logger, getPackageManager };
4 changes: 2 additions & 2 deletions packages/webpack-cli/lib/webpack-cli.js
Expand Up @@ -227,7 +227,7 @@ class WebpackCLI {
return flags;
}

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

await this.program.parseAsync(args);
await this.program.parseAsync(args, parseOptions);
}

async resolveConfig(options) {
Expand Down

0 comments on commit 2af0801

Please sign in to comment.