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 the docs and this comment I should be able to use the --node-env option to set bothprocess.env.NODE_ENV and mode but I cannot get this to work as expected.
Using the following webpack.config.js configuration:
I want to say it works as expected, argv contains arguments which you provided as CLI arguments, i.e. you pass only --node-env, so just use argv.nodeEnv to get value, we set the mode option after loading configuration, also you can use process.env.NODE_ENV because we set it before loading configuration
According to the docs and this comment I should be able to use the
--node-env
option to set bothprocess.env.NODE_ENV
andmode
but I cannot get this to work as expected.Using the following
webpack.config.js
configuration:...and the following
package.json
file:Running the
npm run build
command outputs the following:Why is
argv.mode
undefined here? Do I still need to set themode
explicitly after all (like below) or what am I doing wrong?The text was updated successfully, but these errors were encountered: