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
{{ message }}
This repository was archived by the owner on Apr 8, 2020. It is now read-only.
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.