Zero-config bundler for npm packages, version 0.14.1. Lean and minimal configuration approach compared to tsdx or microbundle. Actively maintained with monthly releases. Ships TypeScript declarations. Requires vitest ^3.0.0, typescript ^5.0.0, and @babel/core ^7.26.0 as peer dependencies since v0.14.0. Handles ESM, CJS, and TypeScript out of the box.
npm install smartbundleVerified import paths — ran on the pinned version, not inferred.
Basic usage of smartbundle to build an npm package from a TypeScript entry point.
Install vitest ^3.0.0 in your project: npm install -D vitest@^3.0.0
Enable 'verbatimModuleSyntax' in tsconfig.json
Replace require('smartbundle') with import statements or use dynamic importEnsure your package.json has either 'exports' or 'bin' field defined
Use defineConfig instead for future compatibility
Install peer deps: npm install -D vitest@^3.0.0 typescript@^5.0.0 @babel/core@^7.26.0 and use ESM imports
Use named import: import { build } from 'smartbundle' instead of import smartbundle from 'smartbundle'Add 'verbatimModuleSyntax': true to tsconfig.json compilerOptions
Add 'exports' or 'bin' field to package.json