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

Deprecate plugin in favor `output.clean`

Open alexander-akait opened this issue 4 years ago • 8 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

alexander-akait avatar Feb 25 '21 17:02 alexander-akait

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

galvarez421 avatar Mar 12 '21 19:03 galvarez421

@galvarez421 it should, what is the problem?

alexander-akait avatar Mar 13 '21 13:03 alexander-akait

@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

https://github.com/webpack/webpack/issues/12949

vovkvlad avatar Mar 23 '21 16:03 vovkvlad

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

alexander-akait avatar Mar 23 '21 16:03 alexander-akait

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

yckbilly1929 avatar Jun 16 '21 09:06 yckbilly1929

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

alexander-akait avatar Jun 16 '21 10:06 alexander-akait

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

yckbilly1929 avatar Jun 16 '21 10:06 yckbilly1929

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

alexander-akait avatar Sep 07 '21 13:09 alexander-akait