I am using the clean-webpack-plugin to clean out my public/js folder.
https://www.npmjs.com/package/clean-webpack-plugin
I have tried everything but always get a /public/js has been removed
plugins: [
new CleanWebpackPlugin(['js/'], {
root: '/public',
verbose: true,
dry: false,
exclude: ['360.jpg']
}),
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:
Here is my console output: