webpack is 3.10. Practice using cleanWebpackPlugin to delete old files under dist.
I"m using webpack-w to listen for file changes and package automatically. But only when you start webpack-w for the first time, the last packaged file is deleted, any code is modified and packaged again, and the last file is not deleted. There are more and more packaged files in the dist folder.
what is the reason?
webpack.config.js file
module.exports = {
entry: {
app: "./app.js"
},
output: {
filename: "[name].bundle.[hash:3].js",
path: path.resolve(__dirname, "dist")
},
plugins: [
//
new cleanWebpackPlugin(["dist/app.bundle.*.js"])
]
}