Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: allow to pass parseOption to CLI class #2299

Merged
merged 2 commits into from Jan 3, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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 @@ -219,7 +219,7 @@ class WebpackCLI {
return flags;
}

async run(args) {
async run(args, parseOptions) {
// Built-in internal commands
const bundleCommandOptions = {
name: 'bundle',
Expand Down Expand Up @@ -708,7 +708,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