johnagan / clean-webpack-plugin

A webpack plugin to remove your build folder(s) before building

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Deprecate plugin in favor `output.clean`

alexander-akait opened this issue · comments

webpack has built-in support for clearing stale assets https://webpack.js.org/configuration/output/#outputclean, so I think we can deprecate this plugin

I think output.clean does not clean the output directory when running webpack-dev-server, while this plugin seems to be able to.

@galvarez421 it should, what is the problem?

@alexander-akait it seems like output.clean does not clean files for webpack dev server, and you confirmed that it is not supposed to in the issue I logged recently

webpack/webpack#12949

I strongly recommend use the writeToDisk option only for files to be read from fs. otherwise you lose performance

commented

output.clean looks good
but not sure if it supports cleanAfterEveryBuildPatterns?

Why do you need cleanAfterEveryBuildPatterns? Can you describe use case?

commented

Why do you need cleanAfterEveryBuildPatterns? Can you describe use case?

I'm currently using it to remove intermediate files like sourcemap, after pushed to sentry
maybe this is not the best practice, but suit the requirement

/cc @johnagan what do you think? Maybe we need some more options for fully replace this plugin?