Why does production build of React app (with Webpack and Babel) use wrong development env with HMR, which causes errors?
问题 I'm trying to create a production build of my React project, but it picks the wrong configuration. In the development version I'm using HMR (Hot Module Replacement). This is configured in .babelrc, under env > development > plugins . When adding an extra node env > production it seems to be ignored. It's still using the development configuration with HMR, which causes an error: Uncaught Error: locals[0] does not appear to be a module object with Hot Module replacement API enabled. You should