Webpack automate set process.env.NODE_ENV to ‘production’ when start with –mode development

Bug report

What is the current behavior?

Webpack automate set process.env.NODE_ENV to 'production' when start with --mode development

If the current behavior is a bug, please provide the steps to reproduce.

Just start:

cross-env NODE_ENV=development webpack \
  --mode development \
  --config internals/webpack/webpack.dev.babel.js \
  --color -p --progress -w

EVEN SET mode: development in config
that still got process.env.NODE_ENV is production

What is the expected behavior?

Expect process.env.NODE_ENV to development when set mode: 'development'

Other relevant information:

webpack version: 4.9.1
Node.js version: v10.1.0
Operating System: macOS 10.13.4
Additional tools:

Author: Fantashit

1 thought on “Webpack automate set process.env.NODE_ENV to ‘production’ when start with –mode development

Comments are closed.