Try removing your root: '/public', key value and remove forward slash from ['js/']

if you really need a root key in your settings, make sure it is an absolute path:

root: __dirname or root: "E:/node_projects/my_project",

Plugin does work for me with these settings:

new CleanWebpackPlugin(['dist'], {
    //root: '/',
    verbose: true,
    dry: false,
    exclude: ['example.txt']
}),

My project setup:

enter image description here

Here is my console output:

enter image description here

Webpack Clean- /public/js has been removed - Stack Overflow

https://stackoverflow.com/questions/43261320/webpack-clean-public-js-has-been-removed

Plugin does work for me with these settings: new CleanWebpackPlugin(['dist'], { // root: '/', verbose: true, dry: false, exclude: ['example.txt'] }),.

dist folder not being removed · Issue #93 · johnagan/clean-webpack ...

https://github.com/johnagan/clean-webpack-plugin/issues/93

Sep 15, 2018 ... new CleanWebpackPlugin(pathsToClean),. The output shows that is worked logging this =>clean-webpack-plugin: {path}\dist has been removed.

clean-webpack-plugin - npm

https://www.npmjs.com/package/clean-webpack-plugin

Apr 10, 2021 ... A webpack plugin to remove/clean your build folder(s). ... TypeScript icon, indicating that this package has built-in type declarations.

It's dosen't work sometimes · Issue #58 · johnagan/clean-webpack ...

https://github.com/johnagan/clean-webpack-plugin/issues/58

Jun 8, 2017 ... webpack.config.js ... var CleanWebpackPlugin = require('clean-webpack-plugin'); ... new ... has been removed. clean-webpack-plugin: ...

npm start提示clean-webpack-plugin:...-慕课网

https://www.imooc.com/qadetail/268800

2018年7月30日 ... npm start提示clean-webpack-plugin: /home/www/imooc/es6-webpack/dist has been removed.

remove-files-webpack-plugin - npm

https://www.npmjs.com/package/remove-files-webpack-plugin?activeTab=readme

Sep 3, 2020 ... A plugin for webpack that removes files and folders before and after compilation. ... that have been removed will be passed into this function.

To v5 from v4 | webpack

https://webpack.js.org/migrate/5/

Some Plugins and Loaders might have a beta version that has to be used in order to be compatible with webpack 5. ... Clean up configuration. Consider removing ... If you are using watch: true in webpack Node.js API, remove it. There's ... If you were using WebAssembly via import, you should follow this two step process:.

How I solved and debugged my Webpack issue through trial, error ...

https://www.freecodecamp.org/news/how-to-solve-webpack-problems-the-practical-case-79fb676417f4/

May 2, 2018 ... And it turned out that the webpack-dev-server has been in maintenance ... + new CleanWebpackPlugin('dist'), //deleted some settings from the ...

How to build oss-web-ui? - Getting Started - Sensu Community

https://discourse.sensu.io/t/how-to-build-oss-web-ui/2083

Oct 9, 2020 ... 22.5 [HPM] Proxy created: /auth,/graphql,/api -> http://localhost:8080 clean- webpack-plugin: /opt/sensu/web/build/app has been removed.

Live Reload / Hot Module Replacement with Webpack Middleware ...

https://blog.cloudboost.io/live-reload-hot-module-replacement-with-webpack-middleware-d0a10a86fc80

Aug 22, 2017 ... Let's start it and see what the client does: $ node server clean-webpack-plugin: C :\projects\react-from-scratch\www has been removed.