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

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 ...

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

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 ...

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

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

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

remove-files-webpack-plugin - npm

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

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 ...

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

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 ...

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.