自学内容网 自学内容网

webpack.config.js配置文件报错: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/configuration/mode/

解决:

在package.json文件里进行修改:增加如下:

scripts": {

   "dev": "webpack-dev-server --mode development",

   "build": "webpack --mode development"


原文地址:https://blog.csdn.net/m0_55333789/article/details/135699626

免责声明:本站文章内容转载自网络资源,如本站内容侵犯了原著者的合法权益,可联系本站删除。更多内容请关注自学内容网(zxcms.com)!