johnagan / clean-webpack-plugin

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

remove cached assets on rebuild #162

Closed Viktor-the-great closed 4 years ago

Viktor-the-great commented 4 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 4 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 4 years ago

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