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?
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too