In the world of modern web development, our toolchains are both incredibly powerful and notoriously complex. We juggle package managers, bundlers like Webpack or Rollup, transpilers like Babel, and a seemingly endless node_modules directory. While these tools enable us to write clean, modular, and future-proof code, the configuration overhead can be a significant drag on productivity.
Enter esbuild, the game-changing bundler written in Go, renowned for its blazing-fast performance—often 10-100x faster than its JavaScript-based counterparts. But what if you could harness that incredible speed without ever touching a config file or running npm install?
That’s precisely the promise of esbuild.do: a powerful agentic workflow that delivers esbuild's capabilities through a simple, on-demand API.
Before we dive into the solution, let's acknowledge the problem. A typical project setup involves:
This workflow is fine for large, long-running projects. But for dynamic environments, serverless functions, or simple one-off tasks, it's overkill. It introduces dependencies, slows down deployments, and adds a layer of complexity that often isn't necessary.
esbuild.do reimagines the build process by turning it into a service. It's not just a wrapper; it's a a streamlined workflow that lets you transpile, bundle, and minify your code on the fly. There's no local installation, no dependency management, and no complex setup.
You simply send your code to the API and get back the processed, optimized result.
Let's see it in action. Imagine you want to take a TypeScript snippet, bundle its logic, and minify it for production use, all in one go. With the @do-inc/sdk, it's this simple:
import { doing } from '@do-inc/sdk';
// Bundle and minify a TypeScript code snippet into a single string.
const { bundledCode } = await doing.esbuild({
entryPoints: ['index.ts'],
sourceFiles: {
'index.ts': `
const message: string = 'Hello, ESBuild!';
console.log(message);
`
},
bundle: true,
minify: true,
platform: 'node',
format: 'esm'
});
console.log(bundledCode);
// Output: console.log("Hello, ESBuild!");
In this example, we provided the TypeScript source code directly within the API call using sourceFiles. We asked esbuild.do to bundle (bundle: true) and minify (minify: true) the code, and a moment later, we received the perfectly optimized JavaScript output. All the complexity of TypeScript compilation and code minification was handled by a single, stateless API call.
This "bundling-as-a-service" model unlocks powerful new possibilities and simplifies existing workflows.
esbuild.do is an agentic workflow that provides the capabilities of the esbuild JavaScript bundler and minifier through a simple, on-demand REST API, eliminating the need for local installation or complex build configurations.
Use esbuild.do in serverless functions, CI/CD pipelines, or any environment where you want to avoid managing local Node.js dependencies. It's perfect for dynamic code transpilation, online playground environments, or radically simplifying build steps in any automated workflow.
esbuild.do supports everything the native esbuild tool does, including JavaScript (.js), TypeScript (.ts, .tsx), JSX, and CSS. You can configure loaders, target versions, and output formats just as you would with the CLI, giving you full control over the build process.
Absolutely. Security is paramount. Each API call runs in a secure, isolated sandbox. Your source code is only used in-memory for the duration of the bundling process and is never stored, logged, or inspected.
esbuild.do offers a paradigm shift. It takes the raw power and speed of the best-in-class JavaScript bundler and makes it accessible everywhere, for any task, without the ceremony. By abstracting the build tool into a simple, powerful API, you can focus on writing code, not wrestling with configuration.
Ready to simplify your workflow? Head over to esbuild.do to learn more and get started.