MCPcopy Index your code
hub / github.com/XaveScor/smartbundle

github.com/XaveScor/smartbundle @v0.14.2

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.14.2 ↗ · + Follow
124 symbols 321 edges 276 files 0 documented · 0%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

SmartBundle

The Library Bundler That Respects Your Time

<a href="#getting-started">Getting Started</a> •
<a href="#features">Features</a> •
<a href="#compatibility">Compatibility</a> •
<a href="#tool-integration">Tool Integration</a> •
<a href="#advanced-usage">Advanced Usage</a> •
<a href="#faq">FAQ</a>

Build your library for any JavaScript environment without the complexity

Getting Started

SmartBundle makes it easy to bundle your library for any JavaScript environment. Just create a minimal package.json (see below), install SmartBundle, and run the build command.

{
  // Your package name
  "name": "my-package",         
  // Package version
  "version": "1.0.0",           
  // Must be true to avoid accidental publishing
  "private": true,              
  // SmartBundle supports only ES modules
  "type": "module",             
  // Entry point used by SmartBundle
  "exports": "./src/index.js",  
  "scripts": {
    // Run this to build your package
    "build": "smartbundle"      
  }
}

Need more details? See our package.json guide for a full explanation of each field. If you plan to use TypeScript, check out our TS guide for tailored advice.

To build your package:

1) Create the package.json as shown above 2) Install SmartBundle:

npm install --save-dev smartbundle@latest

3) Build your package:

npm run build

4) Your built files (including an auto-generated package.json) will be in the ./dist folder

Features

  • Zero Configuration - Point to your entry file and build
  • Universal Output - ESM and CommonJS bundles generated automatically
  • TypeScript Ready - Full TypeScript support with type definitions
  • React Support - Automatic JSX transformations for modern and legacy modes
  • Developer Friendly - Source maps included for better debugging
  • Broad Compatibility - Works with Node.js, Webpack, Vite, Rollup, Bun, and more

Compatibility

Every bundled package is tested in real environments - from Node.js and Bun to Webpack and Metro - to ensure it just works.

Runtimes

Runtime Version Supported E2E Tests
Node.js ^18.0.0
^20.0.0
^22.0.0
^23.0.0
Bun ^1.0.0
Deno ^2.0.0 -

Bundlers

Bundler Version Supported E2E Tests
Webpack ^4.47.0
^5.95.0
Rspack ^1.0.0
Vite ^5.0.0 -
Rollup ^4.0.0 -
Parcel ^2.0.0 -
Browserify ^17.0.0 -
Esbuild ^0.24.0 -
Metro ^0.81.0
Next.js/Turbopack ^13.0.0 -

TypeScript Module Resolution

Strategy Supported E2E Tests
bundler
node10
node16es
node16cjs

We aim to support as many bundlers and runtimes as possible. If the bundled package doesn't work with your bundler, please let us know.

Tool Integration

SmartBundle automatically detects and integrates with your tools - just add what you need to your project.

TypeScript

Add typescript@^5.0.0 as a dev dependency and start creating .ts files. SmartBundle will handle the rest.

Babel

Add @babel/core@^7.0.0 as a dev dependency and create a Babel configuration file in your project root. SmartBundle will automatically apply your transformations.

React

Add react to your dependencies. SmartBundle automatically detects React and configures JSX transformations. Both modern and legacy modes are supported.

For detailed React configuration options, see our React guide.

Advanced Usage

SmartBundle enforces certain package.json conventions to ensure reliable builds. For detailed information about: - Required and banned fields - Configuration limitations - Package.json best practices

See our package.json guide.

FAQ

SmartBundle have an issue

Please, look at the known fixable issues before creating your own one. Some bugs already have a solution but cannot be fixed without user action.

Why don't you minify the output?

Minification is typically needed only for production. During development, readable, unminified output helps with debugging.

Why do you require third-party tools for building?

We prioritize keeping the node_modules size manageable and avoid unnecessary dependencies. If your package does not require TypeScript, for instance, you don’t need to install those specific tools.

Community and Support

If you need assistance or wish to contribute, please check out our discussion forum and issue tracker.

Core symbols most depended-on inside this repo

inlineExtensionsMjs
called by 35
src/tasks/buildTypesTask/inlineExtensions.ts
inlineExtensionsCjs
called by 33
src/tasks/buildTypesTask/inlineExtensions.ts
run
called by 31
src/index.ts
parsePackageJson
called by 23
src/packageJson.ts
okLog
called by 11
src/log.ts
myResolve
called by 6
src/resolveDirs.ts
log
called by 5
src/log.ts
errorLog
called by 5
src/log.ts

Shape

Function 115
Class 6
Method 3

Languages

TypeScript100%

Modules by API surface

src/tasks/buildTypesTask/findTypingsPackages.ts8 symbols
src/packageJson.ts7 symbols
src/tasks/buildTypesTask/inlineExtensions.ts6 symbols
src/log.ts6 symbols
src/tasks/buildTypesTask/findTypingsNames.ts5 symbols
src/plugins/imports/index.ts5 symbols
src/detectModules.ts5 symbols
e2e/e2e.test.ts5 symbols
src/plugins/imports/ImportError.ts4 symbols
src/plugins/babel/index.ts4 symbols
src/plugins/react/index.ts3 symbols
src/index.ts3 symbols

For agents

$ claude mcp add smartbundle \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact