错误描述:
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/
错误原因:
上述错误是因为我们没有设置 webpack 的模式(生产-production,开发-development)
解决办法:
打开 DOS 窗口,执行 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]