Microbundle is a zero-configuration bundler for small JavaScript libraries, currently at version 0.15.1. Powered by Rollup, it simplifies the build process by automatically generating optimized bundles in multiple formats: CommonJS (CJS), ECMAScript Modules (ESM), Universal Module Definition (UMD), and a 'modern' ESM bundle for contemporary browsers. It supports ESnext features, async/await, multiple entry points, TypeScript out-of-the-box, built-in Terser compression, and gzipped bundle size tracking. While not adhering to a strict release cadence, it receives frequent updates, often in the form of patch releases, indicating active maintenance. Key differentiators include its minimal setup (often just `package.json` configuration) and focus on producing tiny, performant outputs with modern browser targets by default.
npm install microbundleVerified import paths — ran on the pinned version, not inferred.
Demonstrates a typical `package.json` setup for Microbundle, defining input/output paths for CJS, ESM, UMD, and modern bundles, along with example source code. Shows how to integrate Microbundle into `npm` scripts for building and watching files.
Update your import paths and `package.json` 'exports' fields to correctly reference `.mjs` files where applicable, especially when migrating projects or upgrading from older Microbundle versions. Ensure your build pipeline and consuming applications correctly resolve `.mjs` extensions.
Upgrade to Microbundle v0.15.1 or later to ensure all CSS assets across multiple entry points are correctly packaged.
Upgrade to Microbundle v0.13.3 or later to ensure Terser annotations are correctly preserved during the build process.
Always define the `exports` field in your `package.json` alongside `main` and `module` to ensure robust and explicit module resolution for various environments, as shown in the quickstart example.
Add a `"source": "src/index.js"` (or your actual source file path) entry to your `package.json`.
Ensure your `package.json`'s `main`, `module`, and `exports` fields correctly point to the appropriate CJS and ESM bundles. For Node.js, ensure `type: "module"` is set for ESM-only packages, or use `.mjs`/`.cjs` extensions explicitly in `exports`.
Update Microbundle to version `0.15.1` or newer. If the issue persists, verify your CSS import paths and ensure they are valid for bundling.
No dependency data recorded yet.