报错
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.
解决
在package.json加入
"dev": "webpack --mode development", "build": "webpack --mode production"
再重建一个名叫webpack.config.js的文件(位置在上图目录中)
写入
const path=require("path"); module.exports = { entry: "./src/main.js",//入口文件路径 output: { path: path.resolve(__dirname, './dist'),//处理过后的文件放置路径 filename: "b.js"//该文件名字 }, mode: 'development' }