Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
fix: handle core flags for webpack 4 (#2023)
  • Loading branch information
anshumanv committed Nov 2, 2020
1 parent 3004549 commit ea66a7e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 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,7 +41,6 @@ class WebpackCLI {
acc[toKebabCase(cur)] = parsedArgs[cur];
return acc;
}, {});
const coreCliHelper = require('webpack').cli;
const coreCliArgs = coreCliHelper.getArguments();
// Merge the core flag config with the compilerConfiguration
coreCliHelper.processArguments(coreCliArgs, this.compilerConfiguration, coreConfig);
Expand Down

0 comments on commit ea66a7e

Please sign in to comment.