我正在
You are currently using minified code outside of NODE_ENV === 'production'. This means that you are running a slower development build of Redux. You can use loose-envify (https://github.com/zertosh/loose-envify) for browserify or DefinePlugin for webpack (http://stackoverflow.com/questions/30030031) to ensure you have the correct code for your production build.
我尝试通过在我的webpack配置中添加以下代码来修复它。但它对Redux来说并不起作用。但是,以下代码确实修复了React的类似警告。
plugins: [
...
new webpack.DefinePlugin({
'process.env': {
'NODE_ENV': '"production"'
}
}),
...
我错过了什么吗?
答案 0 :(得分:1)
经过一些试验和错误后才能正常工作
plugins: [
new webpack.DefinePlugin({
'process.env': {
'NODE_ENV': '"production"'
}
})
]
然后在我的package.json中运行npm脚本“build:webpack”,它执行以下操作
"build:webpack": "webpack -p --define process.env.NODE_ENV='\"production\"'"