microbundle
Microbundle is a zero-configuration bundler for tiny JavaScript modules, designed to produce optimized library bundles with minimal setup. Created by Jason Mill…
Installation
npm install -D microbundle
yarn add -D microbundle
pnpm add -D microbundle
Import
// No config needed — reads package.json
Quick Example
// package.json
{
"source": "src/index.js",
"main": "dist/index.cjs",
"module": "dist/index.mjs",
"types": "dist/index.d.ts",
"scripts": {
"build": "microbundle",
"dev": "microbundle watch"
}
}About microbundle
Microbundle is a zero-configuration bundler for tiny JavaScript modules, designed to produce optimized library bundles with minimal setup. Created by Jason Miller (creator of Preact), Microbundle reads your package.json fields (main, module, exports, types) to automatically determine output formats and filenames, then uses Rollup under the hood to produce CommonJS, ESM, and UMD builds in a single command. The tool includes TypeScript support with automatic declaration file generation, JSX support for React and Preact, CSS modules, source maps, and tree shaking. Microbundle's --css-modules flag enables scoped CSS class names, and --compress enables Terser minification with size output reporting. The zero-config philosophy means library authors can get started by running microbundle with no configuration file — it infers everything from package.json. Microbundle handles the complexity of producing correctly formatted dual CJS/ESM packages that work with both import and require. While tsup has become more popular for TypeScript libraries, Microbundle remains a solid choice for JavaScript libraries and projects where simplicity and Rollup's output quality are preferred over esbuild's speed.
Quick Facts
| Package | microbundle |
| Category | Build Tool |
| Weekly Downloads | 100K+ |
| License | MIT |
| Install | npm install -D microbundle |
Related Packages
tsup is a zero-config TypeScript bundler powered by esbuild, designed specifically for building Type…
Rollup is a JavaScript module bundler that compiles small pieces of code into larger, more complex b…
unbuild is a unified JavaScript build system created by the UnJS team that provides a preset-based, …
esbuild is an extremely fast JavaScript and TypeScript bundler and minifier written in Go that is 10…
Preact is a fast 3kB alternative to React with the same modern API. It provides the thinnest possibl…
Browse npm Packages by Category
Explore our reference of 200 popular npm packages with install commands, examples, and quick-start guides.