Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature]: Webpack's output.clean supports the useful option to optionally keep some files around #7822

Open
Tracked by #8445
matthiask opened this issue Sep 6, 2024 · 3 comments
Assignees
Labels
feat New feature or request pr welcome

Comments

@matthiask
Copy link

What problem does this feature solve?

Thank you for all the work y'all are doing on rspack! Not having to rethink all the frontend building configuration is really great.

Here's the documentation for the option:
https://webpack.js.org/configuration/output/#outputclean

I especially like using clean: { keep: /\.html$/ } to keep the generated HTML files around, so that different build or development processes do not delete each other's HTML files (generated by the html-webpack-plugin).

I could use different folders for each of them, but I thought it's worth submitting since it's a difference to webpack

What does the proposed API of configuration look like?

Webpack uses boolean | { dry?: boolean, keep?: RegExp | string | ((filename: string) => boolean) } according to the docs. A very useful, limited first step would be boolean | { keep?: RegExp }. I don't think the other options are needed except for feature parity. dry-running shouldn't matter -- if you want to clean up, clean up. If you do not, then don't. I also don't know why you'd want to use a callable here.

@matthiask matthiask added feat New feature or request pending triage The issue/PR is currently untouched. labels Sep 6, 2024
@h-a-n-a h-a-n-a added pr welcome and removed pending triage The issue/PR is currently untouched. labels Sep 9, 2024
@shulaoda
Copy link
Collaborator

shulaoda commented Nov 4, 2024

Welcome to close #7845 at any time, I may not have enough time to support it at the moment.

@ClSlaid
Copy link
Contributor

ClSlaid commented Nov 12, 2024

cc @shulaoda @h-a-n-a , I'd like to take a look.

@shulaoda
Copy link
Collaborator

cc @shulaoda @h-a-n-a , I'd like to take a look.

Welcome!👏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat New feature or request pr welcome
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants