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

feat(dts): support bundle dts #573

Merged
merged 2 commits into from
Aug 22, 2024
Merged

Conversation

SukkaW
Copy link
Contributor

@SukkaW SukkaW commented Aug 15, 2024

Fix #560

Added a CLI flag --dts-bundle that will enable rollup-plugin-dts's respectExternal option.

@@ -90,6 +91,7 @@ function parseCliArgs(argv: string[]) {
sourcemap: !!args['--sourcemap'],
cwd: args['--cwd'],
dts: args['--no-dts'] ? false : undefined,
dtsBundle: args['--dts-bundle'],
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of introducing a new option, we can use --no-external to achieve it.
If we bundle all the dependencies, then we bundle all the types to align as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Per rollup-plugin-dts, enabling bundle dts is not recommended. So IMHO we should split this into a separate option.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yea but I still believe users want to have types as bundled instead of relying on separate package when they specify --no-external.

I want to support types bundling for that case too. if types not working they can have a way to opt-out types bundling. I'll leave these items for later. Current approach looks good! Thanks

@huozhi huozhi merged commit 5f45bcd into huozhi:main Aug 22, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add --dts-resolve flag like tsup
2 participants