The CI/CD pipeline is the backbone of modern software development, but it's often plagued by a persistent bottleneck: the build step. We've all been there, watching the logs as npm install or yarn install chews through minutes of precious build time, downloads hundreds of megabytes of dependencies, and occasionally fails for cryptic reasons.
For projects using JavaScript, TypeScript, or JSX, this build step—involving transpilation, bundling, and minification—is a necessary evil. It adds complexity, fragility, and significant overhead to our deployment process.
But what if it didn't have to be this way? What if you could offload that entire process to a dedicated, blazing-fast service and replace complex setup scripts with a single API call?
The traditional approach to handling JavaScript builds in a CI/CD environment looks something like this:
This workflow introduces several challenges:
esbuild.do reimagines this entire process. It harnesses the incredible speed of esbuild, the famously fast JavaScript bundler, and exposes it through a simple and powerful API. Instead of installing and configuring build tools in your pipeline, you simply send your code to the API and get production-ready, bundled code back in milliseconds.
This "Bundling-as-a-Service" model transforms your build step from a complex, multi-stage process into a single, dependency-free network request.
With the @do-inc/sdk, you can transpile, bundle, and minify your code with an agentic workflow that feels like calling a local function. There's no file system to manage, no node_modules to install—just your source code and the options you need.
Here’s how you can bundle a TypeScript snippet into a single, minified string of JavaScript:
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 a CI/CD script, this could be a simple curl command or a step in a Node.js script, completely replacing the npm install and npm run build sequence.
Integrating esbuild.do into your CI/CD pipeline delivers immediate and impactful improvements.
By eliminating the npm install step for your build tools, you can slash minutes off your pipeline's execution time. API calls to esbuild.do are extremely fast, leveraging the raw performance of esbuild running on optimized infrastructure.
Your pipeline configuration becomes radically simpler. What was once a series of commands to set up Node, install dependencies, and run a build script is now a single command. This makes your pipelines easier to read, maintain, and debug.
Your build containers no longer need Node.js, npm, or any build-related devDependencies. This results in smaller Docker images, faster container startup, and a reduced attack surface. You can build your frontend assets in an environment that has no access to node_modules.
Say goodbye to build failures caused by environment drift. The esbuild.do API provides a consistent and managed environment for every run, ensuring that your code is bundled the same way, every time, regardless of where the pipeline is triggered.
Q: What is esbuild.do?
A: 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.
Q: Why use esbuild.do instead of the esbuild CLI?
A: While the esbuild CLI is fantastic for local development, esbuild.do excels in ephemeral or isolated environments like serverless functions, CI/CD runners, or online code playgrounds. It allows you to leverage esbuild's power without managing local Node.js dependencies, simplifying and speeding up your workflows.
Q: What file types can I process?
A: esbuild.do supports everything the native esbuild tool does, including JavaScript, TypeScript (TS/TSX), JSX, and CSS. You can configure loaders, target versions, and output formats just as you would with the CLI.
Q: Is it secure to send my source code to the API?
A: Absolutely. Security is paramount. Each API call runs in a secure, isolated sandbox. Your source code is used only for the duration of the bundling process and is not stored or logged.
Stop wasting time and resources on slow, complicated build steps. Decouple your build logic from your CI environment and embrace the speed and simplicity of bundling-as-a-service.
Visit esbuild.do to learn more and streamline your CI/CD pipeline today.