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

Bundle format conditional noExternal setting #940

Open
xenobytezero opened this issue Jun 29, 2023 · 0 comments
Open

Bundle format conditional noExternal setting #940

xenobytezero opened this issue Jun 29, 2023 · 0 comments

Comments

@xenobytezero
Copy link

xenobytezero commented Jun 29, 2023

I will try and simplify our setup to explain my use case.

We have a front-end project and NodeJS back-end project, with both projects using a common support library. The front end uses Rollup to bundle for the browser, the backend just compiles TypeScript to CJS (via TSC) to be executed by Node.

The plan originally was to use tsup to produce a CJS and ESM version of this library for maximum compatibility, which seems to be pretty straight forward.

The issue we have is that there is a package that we use in the support library that only ships as ESM.

While we can just add this package to noExternals it does mean that our ESM package is bigger than it needs to be, and also cant delegate tree-shaking etc to downstream bundlers.

Is it possible to have the contents of noExternals configurable by bundle format, so that some dependencies can be bundled and some cannot?

Upvote & Fund

  • We're using Polar.sh so you can upvote and help fund this issue.
  • We receive the funding once the issue is completed & confirmed by you.
  • Thank you in advance for helping prioritize & fund our backlog.
Fund with Polar
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

No branches or pull requests

1 participant