webpack打包代码:
webpack runoob1.js bundle.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/
报错图片如下:
解决方法:
webpack4.0对语法要求更加严格,需要指定的相关信息,输入的打包代码应该修改为:
webpack runoob1.js --output-filename bundle.js --output-path . --mode development
运行结果如下: