webpack打包错误:WARNING in configuration The 'mode' option has not been set......

1、错误描述

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/

2、错误原因

没有设置webpack的模式,是生产还是开发(production or development)

3、解决办法

在cmd命令框中

执行命令:webpack --mode=production  或者  webpack --mode=development

image.png


作者:饥人谷_Leonardo
链接:https://www.jianshu.com/p/d71b27d0dfb5
来源:简书

标签: webpack 自动化构建工具

演示站
上一篇:git中各种命令中的origin和master如何理解和操作?
下一篇:webpack中hash、chunkhash和contenthash三者的区别

发表评论