Skip to content

Conversation

0x80
Copy link
Owner

@0x80 0x80 commented Aug 12, 2025

Fixes #43

Summary

This PR replaces the tsup bundler with bunchee across all packages in the monorepo, improving build performance and simplifying the build pipeline.

Changes Made

All Packages

  • Core Package: Replaced tsup with bunchee in build script
  • API Service: Replaced tsup with bunchee in build script
  • Functions Service: Replaced tsup with bunchee in build script
  • Removed tsup.config.ts files from all packages
  • Updated build commands to use bunchee --sourcemap --runtime node --target es2022

Dependencies

  • Added bunchee@^6.6.0 to all packages
  • Removed tsup@^8.3.6 from all packages
  • Cleaned up duplicate module field in package.json files

Build Configuration

  • Build commands now use bunchee's native Node.js runtime targeting
  • Maintained sourcemap generation for debugging
  • Preserved ES2022 target compatibility

Build Pipeline Simplification

  • No more tsc declaration emission: bunchee handles TypeScript declaration file generation natively
  • No more tsc-alias dependency: bunchee automatically resolves TypeScript path aliases during bundling
  • Cleaner build process: Single command now handles bundling, declarations, and alias resolution

Benefits

  • Faster builds: bunchee is generally faster than tsup for Node.js targets
  • Smaller bundles: More efficient bundling for server-side code
  • Simplified config: Removed need for separate tsup configuration files
  • Better tree-shaking: bunchee provides improved dead code elimination
  • Streamlined pipeline: Eliminated need for post-build TypeScript compilation and alias processing
  • Native TypeScript support: Better integration with TypeScript ecosystem

@0x80 0x80 merged commit a18b717 into main Aug 12, 2025
1 check passed
@0x80 0x80 deleted the thijs/0812-replace-tsup-with-bunchee branch August 12, 2025 09:53
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

Successfully merging this pull request may close these issues.

Simplify build and bundling setup with Bunchee

1 participant