Use NODE_ENV in source code to control build process with Webpack
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I am setting up Redux DevTools ( https://www.npmjs.com/package/redux-devtools ) in my project and want to exclude the DevTools when building my project for production. The documentation says that this can be accomplished by using this code: if ( process . env . NODE_ENV === 'production' ) { module . exports = require ( './configureStore.prod' ); } else { module . exports = require ( './configureStore.dev' ); } I already have a module with constants so I have put the checking for the NODE_ENV in there. Constants . PRODUCTION =