Webpack's cleanWebpackPlugin plug-in fails

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?
clipboard.png

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"])
     ]
 }
Jun.05,2021

https://www.cnblogs.com/oufen. configure the root configuration item to try

Menu