webpack-cleanup-plugin icon indicating copy to clipboard operation
webpack-cleanup-plugin copied to clipboard

Add 'cleanupOnlyLastBuild' option

Open chrisblossom opened this issue 8 years ago • 5 comments

This adds a selfOnly option that will only remove files that the current Webpack compilation has created.

Can be used in combination or as an alternative to exclude.

chrisblossom avatar Jun 13 '17 13:06 chrisblossom

👋 thanks for the idea! What is the use case for this?

gpbl avatar Jun 13 '17 15:06 gpbl

On my build setup I copy a lot of static files to my public build directory before Webpack's compilation. I would need to either continually keep the exclude option updated with new static files without this option.

IMO this should be default as this plugin's goal is to cleanup Webpack's assets, not clean the build directory. Unless I am mistaken?

chrisblossom avatar Jun 13 '17 15:06 chrisblossom

It makes sense. What about calling the option cleanupOnlyLastBuild or something like that?

gpbl avatar Jun 13 '17 15:06 gpbl

Works for me. PR incoming

chrisblossom avatar Jun 13 '17 15:06 chrisblossom

Any other changes requested?

chrisblossom avatar Jun 13 '17 16:06 chrisblossom