webpack打包The 'mode' option has not been set,錯誤提示 原


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"
},
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章