webpack打包The 'mode' option has not been set,错误提示

2019独角兽企业重金招聘Python工程师标准>>> 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"
},

转载于:https://my.oschina.net/jishuge/blog/1838035

上一篇:webpack 对 development 和 production 进行区分打包


下一篇:c# – 在生产应用程序中使用ASP.NET MVC 2 Preview 1是否可行?