Skip to content

Commit cfa2c16

Browse files
fix exclude public argument to validate command
1 parent e991ad8 commit cfa2c16

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

bin/encore.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,15 @@ if (runtimeConfig.outputJson) {
3030
process.argv.splice(2, 1);
3131

3232
// remove arguments not supported by webpack/-dev-server
33-
const encoreOnlyArguments = new Set(['--keep-public-path', '--public']);
33+
const encoreOnlyArguments = new Set(['--keep-public-path']);
3434
process.argv = process.argv.filter(arg => !encoreOnlyArguments.has(arg));
3535

36+
// remove argument --public not supported by webpack/dev-server
37+
const indexPublicArgument = process.argv.indexOf('--public');
38+
if (indexPublicArgument !== -1) {
39+
process.argv.splice(indexPublicArgument, 2);
40+
}
41+
3642
if (!runtimeConfig.isValidCommand) {
3743
if (runtimeConfig.command) {
3844
console.log(chalk.bgRed.white(`Invalid command "${runtimeConfig.command}"`));

0 commit comments

Comments
 (0)