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

fix: handle core flags for webpack 4 #2023

Merged
merged 2 commits into from Nov 2, 2020
Merged
Changes from 1 commit
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
4 changes: 3 additions & 1 deletion packages/webpack-cli/lib/webpack-cli.js
Expand Up @@ -31,6 +31,8 @@ class WebpackCLI {
* @returns {void}
*/
_handleCoreFlags(parsedArgs) {
const coreCliHelper = require('webpack').cli;
if (!coreCliHelper) return;
const coreConfig = Object.keys(parsedArgs)
.filter((arg) => {
return coreFlagMap.has(toKebabCase(arg));
Expand All @@ -39,8 +41,8 @@ class WebpackCLI {
acc[toKebabCase(cur)] = parsedArgs[cur];
return acc;
}, {});
const coreCliHelper = require('webpack').cli;
const coreCliArgs = coreCliHelper.getArguments();
console.log(coreCliArgs, coreCliHelper);
anshumanv marked this conversation as resolved.
Show resolved Hide resolved
anshumanv marked this conversation as resolved.
Show resolved Hide resolved
// Merge the core flag config with the compilerConfiguration
coreCliHelper.processArguments(coreCliArgs, this.compilerConfiguration, coreConfig);
// Assign some defaults to core flags
Expand Down