自动清除打包目录
webpack4
// bash
npm i clean-webpack-plugin -D
//webpack.config.js
const {CleanWebpackPlugin} = require('clean-webpack-plugin');
module.exports = {
plugins: [
new CleanWebpackPlugin()
}
}
webpack5
module.exports = {
output: {
clean: true
}
}