WARNING in configuration
The 'mode' option has not been set, webpack will fallback to 'production' for this value. Set 'mode' option to 'development' or 'production' to enable defaults for each environment.
You can also set it to 'none' to disable any default behavior. Learn more: https://webpack.js.org/concepts/mode/
这是没有配置环境的原因!
解决方案:在package.json文件中添加.最好是把webpack 也写上,不然windows还是会报错的.
"scripts": { "dev": "webpack --mode development", "build": "webpack --mode production" },
转载于:https://my.oschina.net/jishuge/blog/1838035