Registry / web-framework / smartbundle

smartbundle

JSON →
library0.14.1jsnpmunverified

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 smartbundle
INSTALL
IMPORT
SIG · SMARTBUNDLE
S
smartbundle
web-frameworkjavascriptv0.14.1
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

build
import { build } from 'smartbundle'
const build = require('smartbundle')
ESM-only since v0.13.0
createConfig
import { createConfig } from 'smartbundle'
import createConfig from 'smartbundle'
Named export, not default
defineConfig
import { defineConfig } from 'smartbundle'
import { defineConfig } from 'smartbundle/config'
Direct from 'smartbundle' since v0.12.0

Basic usage of smartbundle to build an npm package from a TypeScript entry point.

import { build, defineConfig } from 'smartbundle'; const config = defineConfig({ entry: 'src/index.ts', formats: ['esm', 'cjs'], outDir: 'dist', tsconfig: 'tsconfig.json', }); console.log('Building...'); build(config).then(() => console.log('Done!'));
smartbundle --version
Debug
Known issues
breakingMinimum peer dependency vitest v3 required since v0.14.0
fix
Install vitest ^3.0.0 in your project: npm install -D vitest@^3.0.0
affects: >=0.14.0
breakingForce verbatimModuleSyntax in TypeScript config since v0.12.4
fix
Enable 'verbatimModuleSyntax' in tsconfig.json
affects: >=0.12.4
breakingESM-only package, require() will fail since v0.13.0
fix
Replace require('smartbundle') with import statements or use dynamic import
affects: >=0.13.0
gotchaexports or bin field required in package.json since v0.14.1
fix
Ensure your package.json has either 'exports' or 'bin' field defined
affects: >=0.14.1
deprecatedcreateConfig function may be deprecated in future in favor of defineConfig
fix
Use defineConfig instead for future compatibility
affects: >=0.12.0
Errors
Common errors & fixes
Error: Cannot find module 'smartbundle'
Missing peer dependencies or ESM/CJS mismatch
fix
Install peer deps: npm install -D vitest@^3.0.0 typescript@^5.0.0 @babel/core@^7.26.0 and use ESM imports
TypeError: smartbundle is not a function
Using default import instead of named import
fix
Use named import: import { build } from 'smartbundle' instead of import smartbundle from 'smartbundle'
Error: verbatimModuleSyntax is required
TypeScript config missing verbatimModuleSyntax in v0.12.4+
fix
Add 'verbatimModuleSyntax': true to tsconfig.json compilerOptions
Error: exports or bin is required
package.json missing exports or bin field in v0.14.1+
fix
Add 'exports' or 'bin' field to package.json
Upgrade
Version history
0.14.1latest on npm
Audit
Dependencies
vitestrequiredPeer dependency for testing integration
typescriptrequiredPeer dependency for TypeScript compilation
@babel/corerequiredPeer dependency for Babel transforms
Agent activity
29 hits · last 30 days
node
26
OpenAI (training)
1
Resources
smartbundle — npm install smartbundle · libregistry