打开 README.md 文件或者全局搜索 “NODE_ENV= ”,找到后如下图
"scripts": { "build": "NODE_ENV=production webpack", "start": "NODE_ENV=development webpack-dev-server" }
替换为如下代码,重新npm run dev 即可
"scripts": { "build": "NODE_ENV=production && webpack", "start": "NODE_ENV=development && webpack-dev-server" }