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
I've got the following webpack.config.js file in which I've added a guard clause to check that the build environment is properly injected (as it should be for webpack 2).
module.exports=function(env){if(env==null){console.log("Environment is not set up. Webpack needs --env.dev or --env.prod arguments, passed to module.exports function(env)");thrownewError("Environment is not set up. Webpack needs --env.dev or --env.prod arguments, passed to module.exports function(env)");}if(env.prod){returnrequire('./config/webpack.prod.js');}else{returnrequire('./config/webpack.dev.js');}}
However, when I try to run the application with hot module replacement (i.e. in development), env is undefined.
Hi,
I've got the following
webpack.config.jsfile in which I've added a guard clause to check that the build environment is properly injected (as it should be for webpack 2).However, when I try to run the application with hot module replacement (i.e. in development),
envis undefined.The Code in
Startup.cslooks like this:How can I fix this? (
process.argv.indexOfis no longer supported in webpack 2)