Skip to content

Commit 2b49e11

Browse files
author
Andreas Freimuth
committed
Filter --keep-public-path from arguments (fixes #180)
The webpack-dev-server dose not know the --keep-public-path argument and fails with an 'Unknown Argument' error if it is aplied. So before webpack-encore hands over controle to webpack-cli/-dev-server it has to remove arguments that only exist for webpack-encore.
1 parent 62b6aef commit 2b49e11

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

bin/encore.js

+4
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ context.runtimeConfig = runtimeConfig;
2323
// remove the command from the output
2424
process.argv.splice(2, 1);
2525

26+
// remove arguments not supported by webpack/-dev-server
27+
const EncoreOnlyArguments = new Set(['--keep-public-path']);
28+
process.argv = process.argv.filter(arg => !EncoreOnlyArguments.has(arg));
29+
2630
if (!runtimeConfig.isValidCommand) {
2731
if (runtimeConfig.command) {
2832
console.log(chalk.bgRed.white(`Invalid command "${runtimeConfig.command}"`));

0 commit comments

Comments
 (0)