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" },