generator-react-webpack-redux icon indicating copy to clipboard operation
generator-react-webpack-redux copied to clipboard

REACT_HOT_LOADER in production build

Open curly33 opened this issue 8 years ago • 1 comments

Hi, I'm seeing an issue where production code contains multiple instances of __REACT_HOT_LOADER__.register(_default, 'default', '/Users/username/…'); when running npm run dist ... even on a fresh project.

I don't have a lot of knowledge about webpack configurations, so I had trouble tracing the issue. I'm hoping someone here can help. Thanks.

curly33 avatar Apr 25 '17 17:04 curly33

I revisited this and tracked this issue to the process.env.NODE_ENV not being set to 'production' in webpack.config.js. See: https://github.com/gaearon/react-hot-loader/issues/357.

To correct this, I updated conf/webpack/Dist.js from: get env() { return 'dist'; }

to: get env() { return 'production'; }

curly33 avatar Aug 31 '17 15:08 curly33