Quickbundle allows you to bundle a library in a quick, fast and easy way:
- Fast build and watch mode thanks to esbuild
- Zero configuration: define the build artifacts in your
package.json
and you're all set! - Support of multiple module formats including
cjs
&esm
- JavaScript, TypeScript, JSX, CSS, JSON, Image and Text support following esbuild support
- TypeScript declaration file (
.d.ts
) generation with bundling support - Bundling can be done for several platform targets including
browser
ornode
- Optimized build with automatic dependency inclusion (
peerDependencies
anddependencies
are not bundled in the final output)
1️⃣ Install by running:
# Npm
npm install quickbundle
# Pnpm
pnpm add quickbundle
# Yarn
yarn add quickbundle
2️⃣ Set up your package configuration (package.json
):
{
"name": "lib", // Package name
"source": "src/index.ts", // Source code entrypoint
"main": "./dist/index.cjs", // CommonJS output file
"module": "./dist/index.mjs", // ESM output file
"types": "./dist/index.d.ts", // Typing output file (if defined, can increase build time)
"platform": "node", // Platform target (optional, by default "browser")
"scripts": {
"build": "quickbundle build", // Production mode (optimizes bundle)
"watch": "quickbundle watch" // Development mode (watches each file change)
}
}
3️⃣ Try it by running:
# Npm
npm run build
# Pnpm
pnpm build
# Yarn
yarn build
- @adbayb/scripts My opinionated toolbox for JavaScript/TypeScript projects
Contribution welcomed! 🤗
- The backend is powered by ESBuild to make blazing-fast builds. A special shoutout to its author Evan Wallace and all contributors.
- The zero-configuration approach was inspired by microbundle. A special shoutout to its author Jason Miller and all contributors.