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
According to npm/cli#8071 (which adds a warning), npm will change the way arguments are parsed in a way that will break the way wireit looks for the --watch environment variable.
Previously, npm run build --foo would set the npm_config_foo environment variable, and we relied upon that fact for detecting when the --watch flag had been sent.
In npm 12, this will be an error about "watch" being an unrecognized npm argument. This seems like a good change for npm (silently eating arguments does seem bad), but I don't believe we currently have another way to enable wireit watch mode.
Proposals:
Add a WIREIT_WATCH=1 environment variable.
Special case --wireit-watch (and perhaps reserve --wireit- prefixed flag) to be extracted from the additional arguments that are usually passed down to the actual command (e.g. npm run build -- --wireit-watch --flag-for-build)
Solve for [discussion] add —watch to the wireit command as an option #553 to allow a script to be configured as intrinsically watching (e.g. a {"watch":true} config setting), so that people can easily define e.g. build:watch scripts instead of using flags in the first place.
I'm leaning towards doing 1 in the short term, because we already handle all other runtime wireit settings with WIREIT_ environment variables and it's very easy, and 3 as a followup.
According to npm/cli#8071 (which adds a warning), npm will change the way arguments are parsed in a way that will break the way wireit looks for the
--watchenvironment variable.Previously,
npm run build --foowould set thenpm_config_fooenvironment variable, and we relied upon that fact for detecting when the--watchflag had been sent.In npm 12, this will be an error about "watch" being an unrecognized npm argument. This seems like a good change for npm (silently eating arguments does seem bad), but I don't believe we currently have another way to enable wireit watch mode.
Proposals:
WIREIT_WATCH=1environment variable.--wireit-watch(and perhaps reserve--wireit-prefixed flag) to be extracted from the additional arguments that are usually passed down to the actual command (e.g.npm run build -- --wireit-watch --flag-for-build){"watch":true}config setting), so that people can easily define e.g.build:watchscripts instead of using flags in the first place.I'm leaning towards doing 1 in the short term, because we already handle all other runtime wireit settings with
WIREIT_environment variables and it's very easy, and 3 as a followup.