Packem
A fast, zero-config bundler for Node.js and TypeScript libraries. Built on Rollup with esbuild, swc, OXC, and sucrase support.
Packem
A bundler for Node.js and TypeScript libraries. Point it at your package.json and get optimized ESM, CJS, and IIFE bundles — with TypeScript declarations, CSS processing, and tree shaking out of the box.
npm install --save-dev @visulima/packem
npx packem init
npx packem buildWhy Packem?
- Zero config — Reads entry points, output formats, and types from your
package.json. No duplicate configuration. - Fast — Choose between esbuild, swc, OXC, or sucrase. Switch compilers with one config change.
- TypeScript first — Generates
.d.tsdeclarations automatically, including isolated declarations. - CSS included — Sass, Less, Stylus, PostCSS, and CSS Modules work without extra plugins.
- React ready — Server Components, Client Components, and server actions are supported.
- Multi-runtime — Target Node.js, browser, edge-light, and react-server from a single build.
Pick a transformer
| Transformer | Speed | Decorators | Type checking |
|---|---|---|---|
| esbuild | Fastest | No | No |
| swc | Very fast | Yes | No |
| OXC | Very fast | Partial | No |
| sucrase | Fast | No | No |
| TypeScript | Moderate | Yes | Yes |
Most projects should start with esbuild. See Transformers for details.
Packages
| Package | Description |
|---|---|
@visulima/packem | Bundler core and CLI |
@visulima/packem-rollup | Rollup plugins and transformer integrations |
@visulima/rollup-plugin-css | CSS processing and optimization |
@visulima/css-style-inject | Runtime CSS injection utility |
@visulima/packem-share | Shared types and constants |
Next steps
- Getting Started — Install Packem and build your first library.
- Configuration — Customize your build for production.
- Examples — Copy-and-paste starters for common setups.
- API Reference — Programmatic usage, hooks, and plugin development.