{"id":18797,"library":"smartbundle","title":"smartbundle","description":"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.","status":"active","version":"0.14.1","language":"javascript","source_language":"en","source_url":"https://github.com/xavescor/smartbundle","tags":["javascript","smartbundle","bundler","npm","package","typescript","esm","cjs"],"install":[{"cmd":"npm install smartbundle","lang":"bash","label":"npm"},{"cmd":"yarn add smartbundle","lang":"bash","label":"yarn"},{"cmd":"pnpm add smartbundle","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Peer dependency for testing integration","package":"vitest","optional":false},{"reason":"Peer dependency for TypeScript compilation","package":"typescript","optional":false},{"reason":"Peer dependency for Babel transforms","package":"@babel/core","optional":false}],"imports":[{"note":"ESM-only since v0.13.0","wrong":"const build = require('smartbundle')","symbol":"build","correct":"import { build } from 'smartbundle'"},{"note":"Named export, not default","wrong":"import createConfig from 'smartbundle'","symbol":"createConfig","correct":"import { createConfig } from 'smartbundle'"},{"note":"Direct from 'smartbundle' since v0.12.0","wrong":"import { defineConfig } from 'smartbundle/config'","symbol":"defineConfig","correct":"import { defineConfig } from 'smartbundle'"}],"quickstart":{"code":"import { build, defineConfig } from 'smartbundle';\nconst config = defineConfig({\n  entry: 'src/index.ts',\n  formats: ['esm', 'cjs'],\n  outDir: 'dist',\n  tsconfig: 'tsconfig.json',\n});\nconsole.log('Building...');\nbuild(config).then(() => console.log('Done!'));","lang":"typescript","description":"Basic usage of smartbundle to build an npm package from a TypeScript entry point."},"warnings":[{"fix":"Install vitest ^3.0.0 in your project: npm install -D vitest@^3.0.0","message":"Minimum peer dependency vitest v3 required since v0.14.0","severity":"breaking","affected_versions":">=0.14.0"},{"fix":"Enable 'verbatimModuleSyntax' in tsconfig.json","message":"Force verbatimModuleSyntax in TypeScript config since v0.12.4","severity":"breaking","affected_versions":">=0.12.4"},{"fix":"Replace require('smartbundle') with import statements or use dynamic import","message":"ESM-only package, require() will fail since v0.13.0","severity":"breaking","affected_versions":">=0.13.0"},{"fix":"Ensure your package.json has either 'exports' or 'bin' field defined","message":"exports or bin field required in package.json since v0.14.1","severity":"gotcha","affected_versions":">=0.14.1"},{"fix":"Use defineConfig instead for future compatibility","message":"createConfig function may be deprecated in future in favor of defineConfig","severity":"deprecated","affected_versions":">=0.12.0"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Install peer deps: npm install -D vitest@^3.0.0 typescript@^5.0.0 @babel/core@^7.26.0 and use ESM imports","cause":"Missing peer dependencies or ESM/CJS mismatch","error":"Error: Cannot find module 'smartbundle'"},{"fix":"Use named import: import { build } from 'smartbundle' instead of import smartbundle from 'smartbundle'","cause":"Using default import instead of named import","error":"TypeError: smartbundle is not a function"},{"fix":"Add 'verbatimModuleSyntax': true to tsconfig.json compilerOptions","cause":"TypeScript config missing verbatimModuleSyntax in v0.12.4+","error":"Error: verbatimModuleSyntax is required"},{"fix":"Add 'exports' or 'bin' field to package.json","cause":"package.json missing exports or bin field in v0.14.1+","error":"Error: exports or bin is required"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}