Closed
Description
I have this config:
new CleanWebpackPlugin(['dist'], {
root: projectRoot,
watch: false
})
But when the watcher run it deletes the folder and start the whole Webpack's build from scratch.
I know the watch
flag is false by default, I added that to make sure it's settled.
I'm using Webpack version 1 due to some IE backward compatibilities, maybe this is the issue?
Thanks.
Activity
Jonathancollinet commentedon May 30, 2017
look at this
Paths (Required)
An [array] of string paths to clean
shlomisas commentedon May 30, 2017
as you can see in my code sample, i already have
['dist']
array as paths to clean, but it still deletes it everytime the watcher build instead of just on the first web pack build.ianseverance commentedon Nov 4, 2017
@shlomisas As originally mentioned by @Jonathancollinet and stated in the documentation:
By passing
dist
as thepath
, you are asking for thedist
folder itself to be cleaned (removed). To remove all of the files within thedist
folder, your config should actually beand if your
dist
folder has multiple levels, make sure to include those paths as wellUpdate clean-webpack-plugin to the latest version 🚀 (#34)
chrisblossom commentedon Mar 4, 2019
Closed in
v2.0.0
via #99. See johnagan/clean-webpack-plugin#usage. Please open a new issue if you continue to have problems.