How to bundle dependencies?
- Dominant language
- TypeScript
- Stars
- 11.3k
- Forks
- 275
- PR merge metrics
- No merged PRs in 30d
Description
Hi, I've got following `tsup.config.ts`:
```ts
import type { Options } from 'tsup';
const env = process.env.NODE_ENV;
export const tsup: Options = {
bundle: true,
skipNodeModulesBundle: false,
};
```
when running `npx tsup src/runtime-libs/runtime-libs.ts --out-dir test --platform=browser`
I can still see in my generated code `__toESM(require("spectorjs")`. I want `sup` to bundle all dependencies, just like `rebuild --bundle` does. How can I achieve it?
Contributor guide
Research direction
Start with tsup.config.ts and the src/runtime-libs/runtime-libs.ts entry point, then run the reported npx tsup command with the shown browser platform and output directory. Compare the generated code with the expected bundled output and verify whether the spectorjs dependency is still emitted as require("spectorjs").
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- build-system, tooling
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100