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]: Support clean distPath of DTS before build #139

Open
Timeless0911 opened this issue Aug 29, 2024 · 4 comments
Open

[Feature]: Support clean distPath of DTS before build #139

Timeless0911 opened this issue Aug 29, 2024 · 4 comments

Comments

@Timeless0911
Copy link
Collaborator

Timeless0911 commented Aug 29, 2024

What problem does this feature solve?

For js outputs, Rsbuild will automatically clean distPath, see more details https://rsbuild.dev/config/output/clean-dist-path#outputcleandistpath

And for DTS outputs, we should also support to control the behaviour of clean DTS distPath after below code:

options.distPath = options.distPath ?? config.output?.distPath?.root;

The default value of clean should directly read from output.cleanDistPath

  • if it is false value, do not remove DTS distPath
  • otherwise, just remove DTS distPath
@chenjiahan
Copy link
Member

Do we need a new option? How about always reading output.cleanDistPath.

@Timeless0911
Copy link
Collaborator Author

Do we need a new option? How about always reading output.cleanDistPath.

That seems better.

@fi3ework
Copy link
Member

As a Rsbuild plugin, the DTS plugin could add a new config field, and defaults to Rsbuild's output.cleanDistPath while could be altered by user. In Rslib, we don't need to expose the config at the moment.

@Timeless0911
Copy link
Collaborator Author

As a Rsbuild plugin, the DTS plugin could add a new config field, and defaults to Rsbuild's output.cleanDistPath while could be altered by user. In Rslib, we don't need to expose the config at the moment.

Rsbuild plugin can directly read output.cleanDistPath, seems no need to add an extra options for rsbuild-plugin-dts

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants