Closed jimblue closed 5 years ago
I must say I am confused about how beforeEmit
worked previously. It is my understanding that the compile hook
happens before the emit
hook, so to me they are accomplishing the same thing, unless you are wanting to clean after the compile
hook. In that case, you should be able to use cleanAfterEveryBuildPatterns
.
I wouldn't be against the idea of adding a custom hook option, but I'd like to understand the use case for this first. Is it possible for you to provide a minimal example to show what issue you are running into?
Ok, let say my app is working well on production and I have new version of the app to build and push. If I launch webpack build and it fails, the dist folder will be empty and my app will be broken.
To prevent that, clean-webpack-plugin should wait for build success before removing dist folder content.
That way the new build will replace the removed one and the app will never be broken in case the build add an error...
Thanks for the explanation, it makes a lot of sense and we already do this for cleanAfterEveryBuildPatterns
.
Any thoughts of why we wouldn't always use the emit
hook over compile
?
@jimblue See #134
Nice!!!! That was fast... thank you
When can we expect a release for this?
Thanks @johnagan, it's working great now !
Issue description or question
Hi,
I've read the doc and a bunch of closed issue about this, but I didn't get how to replicate beforeEmit of V1?
Just need to stop removing all assets before webpack even start to bundle them...
Thank you so much for you help.
Cheers
Webpack Config
Environment