You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
package.json webExt section doesn't support global options for commands #3571
UsageError: The config file at /REDACTED/package.json specified an unknown option: "sourceDir"
or
UsageError: The config file at /REDACTED/package.json specified an unknown option: "ignoreFiles"
What is the expected or desired behavior?
It would be useful to be able to set these global options on specific commands, rather than only being able to set them for the entire project.
The current workaround is to spread config between the webExt block and aliasing commands with the correct args as scripts which works but can make debugging tricky as config is now being set in multiple places.
@xM8WVqaG did you already tried to set the global option outside of the command-specific properties?
Based on our docs (see here) that should be working instead, if that doesn't work it may be a regression or an issue with some of the global options.
Thanks for replying. Yes you can set the global options outside the command-specific properties but that doesn't work for my usecase where the run command should only watch the compiled ./dist dir and the lint command should be doing the opposite.
This ticket is about the inconsistency of only being able to only set these arguments at the project level using the webExt config, when you can set them on a per-command basis if you're calling them directly.
I'm currently having to workaround this by spreading the config across two places instead of having a single place for config:
This is a reasonable feature request. The option parsing logic is complicated (a combination of custom parsing and relying on yargs), but if a patch were to be provided that implements this in a reasonable way, we'd accept patches.
In the meantime, the work around is to pass the command specific options via the command line rather than the config file, as seen in the last comment above.
Activity
rpl commentedon Dec 18, 2025
@xM8WVqaG did you already tried to set the global option outside of the command-specific properties?
Based on our docs (see here) that should be working instead, if that doesn't work it may be a regression or an issue with some of the global options.
xM8WVqaG commentedon Dec 18, 2025
Thanks for replying. Yes you can set the global options outside the command-specific properties but that doesn't work for my usecase where the
runcommand should only watch the compiled./distdir and thelintcommand should be doing the opposite.This ticket is about the inconsistency of only being able to only set these arguments at the project level using the
webExtconfig, when you can set them on a per-command basis if you're calling them directly.I'm currently having to workaround this by spreading the config across two places instead of having a single place for config:
{ "scripts": { // Other scripts removed for noise "start:web-ext": "web-ext run --source-dir dist" "lint:web-ext": "web-ext lint --ignoreFiles 'dist/**'" }, "webExt": { "run": { "startUrl": [ "https://example.com/webext-debug" ] }, "lint": { "warningsAsErrors": true }, } }Rob--W commentedon Jan 15, 2026
This is a reasonable feature request. The option parsing logic is complicated (a combination of custom parsing and relying on
yargs), but if a patch were to be provided that implements this in a reasonable way, we'd accept patches.In the meantime, the work around is to pass the command specific options via the command line rather than the config file, as seen in the last comment above.