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

[BUG] Many duplicated type files #824

Open
2 tasks done
veksa opened this issue Oct 29, 2024 · 1 comment
Open
2 tasks done

[BUG] Many duplicated type files #824

veksa opened this issue Oct 29, 2024 · 1 comment
Labels

Comments

@veksa
Copy link

veksa commented Oct 29, 2024

Before you begin...

  • I have searched the existing issues
  • I am not using version 13.x of node (if so, please upgrade)

Description of the problem

After switching to building with tsc (#763), the resulting bundles contain many duplicate type files for each bundle type (CJS, ESM, etc.).

image
image

This can be resolved by generating types only once, instead of doing it for each bundle separately.

This can be achieved by building with tsup (https://github.com/egoist/tsup).

Recipe for reproducing

No response

Additional information

No response

Environment

No response

@veksa veksa added the bug label Oct 29, 2024
@broofa
Copy link
Member

broofa commented Oct 29, 2024

Other than increasing the package size (by ~400K), can you elaborate on what adverse impacts this has?

I'm open to ways to dedupe the type files but the current setup is simple and obvious, which tends to pay dividends when it comes to maintainability.

Regarding tsup, not having used it before it's not clear to me how it helps. For example, tsup src --format cjs,esm --dts --clean --sourcemap results in a dist directory that's 30% larger than what we have currently (1.9M vs 1.4M) ... and that doesn't include browser-specific builds.

If you'd like to put up a PR that shows how you'd solve this issue, I'd be curious to see what you have in mind.

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

No branches or pull requests

2 participants