webpack基础_7自动清空上次打包资源
自动清空上次打包资源
1. 配置
webpack.config.js
output: {
path: path.resolve(__dirname, "dist"),
filename: "static/js/main.js",
//原理:在打包前,将path整个目录里的内容清空,再打包
clean: true, // 自动将上次打包目录资源清空
},
webpack.config.js
output: {
path: path.resolve(__dirname, "dist"),
filename: "static/js/main.js",
//原理:在打包前,将path整个目录里的内容清空,再打包
clean: true, // 自动将上次打包目录资源清空
},