A high-performance bundler API powered by Bun that bundles React/Vite apps on-demand in the cloud.
POST /bun
Bundle your React/Vite app with multiple entry points
{
"files": {
"index.tsx": "import React from 'react'; ...",
"App.tsx": "export function App() { ... }",
"package.json": "{ ... }"
},
"entrypoints": ["index.tsx"],
"minify": true,
"sourcemap": "none",
"target": "browser",
"splitting": true,
"format": "esm",
"development": false
}
{
"success": true,
"outputs": [
{
"path": "index.tsx",
"content": "...",
"kind": "entry-point",
"size": 12345
}
],
"buildTime": 123.45,
"logs": [
{
"message": "Warning message",
"level": "warning",
"position": {
"file": "App.tsx",
"line": 10,
"column": 5,
"lineText": " const x = 1;"
}
}
]
}
{
"success": false,
"error": "Build failed",
"buildTime": 45.67,
"logs": [
{
"message": "Cannot find module 'react'",
"level": "error",
"position": {
"file": "index.tsx",
"line": 1,
"column": 23,
"lineText": "import React from 'react';"
}
}
]
}
POST /esbuild
Bundle your React/Vite app using esbuild (same request/response as /bun)
Uses a virtual file system instead of writing temp files to disk
GET /health
Health check endpoint
files (required): Object mapping file paths to their contententrypoints (required): Array of entry point file pathsminify (optional, default: true): Enable minificationsourcemap (optional, default: "none"): Sourcemap generation ("none" | "inline" | "external" | "linked")target (optional, default: "browser"): Build target ("browser" | "bun" | "node")splitting (optional, default: true): Enable code splittingformat (optional, default: "esm"): Output format ("esm" | "cjs" | "iife")development (optional, default: false): Enable development mode (sets NODE_ENV=development, disables minify, enables React Fiber access)See example-client.ts for usage examples.