:fire: Quick setup for performance orientated, offline-first React.js applications featuring Redux, hot-reloading, PostCSS, react-router, ServiceWorker, AppCache, FontFaceObserver and Mocha.
I would like to set NODE_ENV to stage so that my code can select a different api endpoint. I would like to test this with a production build. I thought I could do this in the package.json file:
"build:stg": "cross-env NODE_ENV=stage webpack --config internals/webpack/webpack.prod.babel.js --color -p --progress --hide-modules --display-optimization-bailout"
webpack would do a production build with the NODE_ENV set to stage. In my webpack.base.babel.js I have this
new webpack.DefinePlugin({
'process.env': {
NODE_ENV: JSON.stringify(process.env.NODE_ENV),
so when my webpack production configurations uses the base, I thought it would set process.env.NODE_ENV to stage. However, when I console.log(process.env.NODE_ENV) it in my app, I get production. Is this being set anywhere else in the webpack config files? I can't seem to find it.