错误:WARNING in configuration The 'mode' option has not been set, webpack will fallback to 'product...

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、解决办法

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

$ ./node_modules/.bin/webpack --mode=development

Hash: 310a9d712d610fa38fef
Version: webpack 4.17.2
Time: 743ms
Built at: 2018-09-05 16:06:05
  Asset      Size  Chunks             Chunk Names
main.js  3.81 KiB    main  [emitted]  main
Entrypoint main = main.js
[./src/index.js] 37 bytes {main} [built]

你可能感兴趣的:(错误:WARNING in configuration The 'mode' option has not been set, webpack will fallback to 'product...)