Bundle format conditional `noExternal` setting
- Dominant language
- TypeScript
- Stars
- 11.3k
- Forks
- 275
- PR merge metrics
- No merged PRs in 30d
Description
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?
Contributor guide
Assessment
This issue has not been assessed yet.