johnagan / clean-webpack-plugin

A webpack plugin to remove your build folder(s) before building
MIT License
1.96k stars 134 forks source link

remove cached assets on rebuild #162

Closed Viktor-the-great closed 5 years ago

Viktor-the-great commented 5 years ago

On this code line fetch only emitted assets.

For this reason I can not use 'cache' option of HtmlWebpackPlugin (removes index.html on rebuild).

What about to pass 'cachedAssets' option to toJson method to fetch cached assets?

chrisblossom commented 5 years ago

I am unsure what you mean about a cachedAssets option.

You either need to set cleanStaleWebpackAssets: false or add negative patterns to cleanAfterEveryBuildPatterns: ['!index.html'].

chrisblossom commented 5 years ago

Going to close this. Please reopen if you are still having an issue.