For a module bundler for libraries and npm packages, the strongest matches are rollup/rollup (Rollup is the definitive JavaScript library bundler, purpose-built for), jaredpalmer/tsdx (tsdx is a dedicated zero-config build tool for bundling) and rolldown/rolldown (Rolldown is a high-performance JavaScript/TypeScript bundler with a Rollup-compatible). egoist/tsup and swc-project/swc round out the shortlist. Each is ranked by relevance to your query, popularity and recent activity.
Tools for packaging JavaScript libraries and modules into optimized bundles for distribution on NPM.
Rollup is an ES module bundler and JavaScript module transpiler. It functions as a build tool that combines JavaScript modules into optimized files and converts modern JavaScript and JSX into various output formats for different runtime environments. The project is distinguished by its static-analysis tree shaking engine, which removes unused code and dead exports to minimize bundle size. It also acts as a code splitting orchestrator, partitioning modules into separate chunks to optimize network requests and load times. The tool provides a hook-based plugin system for extending build logic,
Rollup is the definitive JavaScript library bundler, purpose-built for producing optimized ESM, CJS, and UMD outputs with built-in tree-shaking, a rich plugin system, and all the features you listed — it is the best match for building modern libraries.
tsdx is a zero-config command line interface and build tool designed for developing, bundling, and distributing TypeScript libraries. It functions as a project scaffolder and development toolchain that initializes new libraries from templates with standardized folder structures and pre-configured dependencies. The project specializes in producing dual-format module distributions, simultaneously generating both CommonJS and ES modules to ensure compatibility across different JavaScript environments. It utilizes a Rollup-based bundling system to compile TypeScript source into optimized distribu
tsdx is a dedicated zero-config build tool for bundling TypeScript libraries via Rollup, delivering dual ESM/CJS outputs with tree-shaking, TypeScript compilation, and Rollup's plugin ecosystem, making it a direct match for a library-focused bundler.
Rolldown is a high-performance JavaScript and TypeScript module bundler written in Rust. It functions as a fast module compiler that implements a Rollup-compatible API to ensure compatibility with existing workflows and plugins while specializing in ECMAScript Module formats. The project distinguishes itself by using a Rust-based core engine and lazy compilation to reduce the time spent resolving and transforming source code. It focuses on minimizing final delivery sizes through static analysis and tree-shaking to remove unused code. The toolset covers a broad range of build capabilities, in
Rolldown is a high-performance JavaScript/TypeScript bundler with a Rollup-compatible API, delivering tree-shaking, multiple output formats, TypeScript support, and a plugin system, making it an ideal choice for building npm-published libraries.
tsup is a build tool designed for the automated compilation and packaging of TypeScript and JavaScript source code into compatible module formats. It functions as a TypeScript library bundler that transforms source files into distributable assets with minimal manual configuration. The project provides a zero-config build pipeline that abstracts complex bundler settings into a simplified interface. It is an esbuild-based tool that produces simultaneous ESM and CommonJS output files from a single source tree to ensure broad environment compatibility. The tool covers high-performance transpilat
tsup is a zero-config TypeScript library bundler built on esbuild, supporting tree-shaking, simultaneous ESM and CJS outputs, TypeScript compilation, minification, source maps, and watch mode, making it a comprehensive fit for building modern JavaScript/TypeScript libraries.
This project is a high-performance compiler written in Rust that transpiles TypeScript and ECMAScript into compatible JavaScript code. It functions as a TypeScript transpiler, a JavaScript minifier, and a JavaScript bundler. The system distinguishes itself through a WebAssembly plugin host that allows the execution of custom transformation rules without modifying the core binary. It also provides specialized compilation for React source code to improve runtime performance and reduce execution overhead. The broader capability surface includes source-to-source compilation, type annotation stri
swc is a high-performance compiler that also functions as a JavaScript bundler with TypeScript support, minification, and a plugin system, making it a valid option for bundling libraries despite its broader capabilities.
esbuild is a high-performance JavaScript bundler and transpiler designed to transform modern web assets into production-ready code. Built with a focus on speed, it utilizes a concurrent execution model to perform parsing, linking, and code generation across multiple CPU cores. The engine handles a wide range of tasks, including TypeScript compilation, JSX transformation, and CSS bundling, while maintaining a consistent build process across diverse environments. What distinguishes the project is its architecture, which leverages memory-mapped file processing and a single-pass transformation st
esbuild is a high-performance JavaScript bundler that supports TypeScript, tree-shaking, minification, source maps, watch mode, and a plugin system, making it a solid choice for building libraries—though it lacks native UMD output, it covers ESM and CJS formats.
Microbundle is a zero-configuration JavaScript module bundler designed to package small libraries and modules into optimized distribution files. It serves as a JavaScript library packager and TypeScript compiler, converting source code into compatible module formats for both browser and server-side runtimes. The tool functions as a bundle size optimizer by mangling object properties and analyzing bundle composition to reduce final file sizes. It also acts as a CSS module processor, converting style imports into external stylesheets or scoped modules to prevent global namespace collisions. It
Microbundle is a zero-config bundler purpose-built for packaging JavaScript and TypeScript libraries into optimized distributions with tree-shaking, multiple output formats, TypeScript support, and watch mode, but it lacks a plugin system, so it covers most of your required features without being fully comprehensive.
nwb is a zero-configuration build toolchain, module bundler, and development server for JavaScript and JSX applications and libraries. It functions as a build system that automatically derives compiler and bundler settings from a project's installed dependencies to remove manual setup. The tool is distinguished by its ability to act as a library compiler, generating multiple distribution formats such as ESM and CJS from a single source for package manager compatibility. It also includes a dedicated headless browser test runner that executes unit tests with integrated watch mode and code cover
nwb is a zero-configuration build toolchain and bundler that compiles JavaScript/JSX libraries into multiple formats (ESM, CJS) with tree-shaking, minification, and external dependency mapping, though TypeScript support and UMD output are not prominently featured.
Webpack is a module bundler that maps project dependencies into a directed acyclic graph to transform diverse file types into optimized, browser-ready assets. It functions as a build pipeline orchestrator, using entry points to recursively resolve imports and bundle modules, scripts, and static assets into a unified output. The project is distinguished by its plugin-based architecture and loader-driven transformation pipeline. It utilizes an event-driven hook system that allows developers to intercept and modify the build process at specific lifecycle stages, enabling custom code transformati
webpack is a mature module bundler that supports tree-shaking, multiple output formats (ESM, CJS, UMD), TypeScript via loaders, externals handling, minification, source maps, watch mode, and a rich plugin system, making it a capable tool for building JavaScript/TypeScript libraries even though it is more commonly associated with web application bundling.
UglifyJS2 is a suite of tools designed for parsing, beautifying, mangling, and minifying JavaScript code. It functions by converting source code into an abstract syntax tree to enable programmatic analysis and transformation, and it includes a dedicated generator for creating associated source maps. The project optimizes web production builds by compressing script logic and removing unreachable code. It utilizes name mangling to shorten variable and property names and implements a beautifier to reconstruct compressed scripts into a human-readable layout. The toolset covers broad capability a
UglifyJS2 is a JavaScript minifier and optimizer, not a module bundler—it compresses and mangling single files but does not bundle modules, handle ESM/CJS/UMD formats, resolve dependencies, or provide a plugin system for building libraries, so it falls short of what you need.
UglifyJS is a tool for JavaScript code minification, AST manipulation, and source beautification. Its primary purpose is to reduce the file size of JavaScript source code by removing whitespace and shortening variable names to optimize frontend build assets. The project differentiates itself through its ability to programmatically analyze and transform code using abstract syntax trees. It performs constant folding analysis and conditional compilation to eliminate unreachable or redundant code, and it employs a multi-pass compression pipeline to maximize total file size reduction. The tool pr
UglifyJS is a JavaScript minifier and AST transformer, not a bundler — it cannot produce multiple library output formats (ESM, CJS, UMD), handle TypeScript, or manage external dependencies the way you need for publishing npm packages.
esm.sh is a proxy-based registry and distribution system for buildless web development. It retrieves packages from external registries and serves them as ES modules directly to the browser, eliminating the need for a local build step. The project transforms TypeScript, JSX, TSX, and Vue files into browser-compatible JavaScript on the fly during the request process. It handles Node.js built-in resolution by mapping internal modules to browser-compatible polyfills and manages dependency versioning and aliasing through URL query parameters. The system optimizes delivery via request-time tree sh
esm.sh is an ES module CDN proxy that serves packages as zero-build browser-ready modules at request time, not a local build tool for producing library distribution bundles — it lives in the same JavaScript module ecosystem but is the wrong category entirely for library-publishing workflows.
| Repository | Stars | Language | License | Last push |
|---|---|---|---|---|
| rollup/rollup | 26.3K | JavaScript | NOASSERTION | |
| jaredpalmer/tsdx | 11.5K | TypeScript | MIT | |
| rolldown/rolldown | 13.8K | Rust | MIT | |
| egoist/tsup | 11.3K | TypeScript | MIT | |
| swc-project/swc | 33.9K | Rust | Apache-2.0 | |
| evanw/esbuild | 39.9K | Go | MIT | |
| developit/microbundle | 8.1K | JavaScript | MIT | |
| insin/nwb | 5.5K | JavaScript | NOASSERTION | |
| webpack/webpack | 65.8K | JavaScript | MIT | |
| mishoo/uglifyjs2 | 13.4K | JavaScript | NOASSERTION |