1:打包js文件时报错如下
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/
ERROR in multi ./src/main.js ./dist/bundle.js
Module not found: Error: Can't resolve './dist/bundle.js' in 'D:\xampp\htdocs\lianxi\webpack5'
@ multi ./src/main.js ./dist/bundle.js main[1]
。
查看webpack版本:4.32.2,可能是版本问题。
解决:
1.npm uninstall webpack -g
全局卸载。
2.npm install webpack@3 -g
安装版本低的webpack即可。