In modern software development, automation is king. We've moved from manual server provisioning to Infrastructure as Code, and from manual testing to robust CI/CD pipelines. The next frontier is the rise of agentic workflows, where specialized services act as intelligent agents, ready to perform complex tasks on demand via a simple API call.
Yet, one crucial part of the development lifecycle has often remained stubbornly complex and tied to local environments: the build process. Managing node_modules, wrestling with version conflicts, and configuring intricate toolchains are common pain points. What if we could treat our build process like any other modern API-driven service?
This is where esbuild.do comes in. It reframes the build process, transforming esbuild's blazing-fast engine into a programmable agent you can integrate into any automated workflow.
Before we dive into the solution, let's acknowledge the problem. Esbuild is renowned for its incredible speed, but using it traditionally still involves a certain amount of ceremony:
These hurdles make it difficult to perform build tasks in lightweight environments or as part of a purely API-driven, agentic system.
esbuild.do is esbuild as a Service. It takes the entire build toolchain—installation, configuration, and execution—and abstracts it behind a clean, powerful API.
Access the incredible speed of esbuild through a simple, scalable API. Bundle and minify your web assets without managing build toolchains.
By treating the build process as a remote agent, you unlock new possibilities. Instead of telling a machine how to build your code step-by-step (npm install, npx esbuild...), you simply send your source code to the esbuild.do agent and tell it what you want: a bundled, minified file.
This service acts as your dedicated JavaScript bundler and TypeScript bundler, available 24/7 without any setup.
Integrating this into your workflow is incredibly straightforward using the @do-business/sdk. There are no binaries to install or configurations to manage. You just call the agent.
Here’s how you can bundle TypeScript code directly from a string:
import { Agent } from '@do-business/sdk';
const esbuild = new Agent('esbuild.do');
// Bundle TypeScript code from a string
async function bundle() {
const { code, map } = await esbuild.bundle({
entryPoints: ['index.ts'],
sources: {
'index.ts': 'const greet = (name: string): string => `Hello, ${name}!`; console.log(greet("World"));'
},
bundle: true,
minify: true,
platform: 'node',
target: 'es2020'
});
console.log('--- Bundled JS ---');
console.log(code);
}
bundle();
Notice the sources object. You provide the agent with a virtual file system—filenames as keys and a string of their content as values. The esbuild.do agent handles the rest, resolving imports and dependencies between your provided sources and returning the final, production-ready code.
Adopting a build tool as a service opens up powerful new workflows that were previously impractical.
Dynamic Bundling in Serverless Functions: Imagine a service that allows users to submit TypeScript snippets. You can use a serverless function to take that code, pass it to the esbuild.do agent, and return runnable JavaScript—all without bundling a heavy Node.js runtime and node_modules with your function.
Streamlining CI/CD Pipelines: Replace slow npm install && npm run build steps in your pipeline with a single, lightning-fast API call. This simplifies your YAML files, speeds up build times, and eliminates a common source of pipeline failures.
Powering Online Code Editors & Playgrounds: Provide instant-feedback environments where users can write TypeScript or modern JavaScript. The esbuild.do esbuild API can transpile and bundle code on the fly, delivering a seamless live-preview experience without bogging down the browser.
Automated Code Generation Systems: In a larger agentic system, one agent might generate TypeScript based on a schema or user prompt. It can then pass that code directly to the esbuild.do agent to be compiled and minified for deployment, creating a fully automated code generation and build pipeline.
esbuild.do provides esbuild's powerful bundling, transpilation, and minification capabilities as a simple and robust API. It allows you to integrate a high-speed build step into any application or workflow without installing or configuring local build tools.
Using esbuild.do abstracts away the complexity of managing binary dependencies, versions, and build environments. It's perfect for serverless functions, CI/CD pipelines, online playgrounds, and any environment where installing Node.js and npm packages is inconvenient.
Just like the underlying tool, our agent supports JavaScript (JS, JSX) and TypeScript (TS, TSX). As a capable CSS minifier and bundler, it can also process CSS, load JSON files, and handle various output formats like IIFE, CommonJS (CJS), and ES Modules (ESM).
You provide an object where keys are filenames and values are the file content as strings. Our agent creates a virtual file system to process these, resolves imports between them, and returns the final bundled code.
esbuild.do is more than just a convenience; it's a paradigm shift. It decouples the power of world-class build tools from the constraints of the local environment. By providing esbuild's capabilities as an intelligent agent, it allows developers to build more dynamic, more resilient, and more efficient automated systems.
Ready to simplify your toolchain and unlock new agentic workflows?
Explore esbuild.do today and experience the future of automated development.