Prefix any JavaScript, TypeScript, or CSS url with this site, and we'll run esbuild on it for you.
Runs in a nearby Deno Deploy edge worker.
Link to the output directly in the browser, or use the response anywhere you see fit.
In short, whenever you don't have an esbuild binary around, and can make http calls. Think CI, prototypes, or hot-linking directly from a browser script tag.
Also when you don't necessarily care about maximum build performance, since this is probably the slowest way to run esbuild on the planet!
If you have TypeScript source with only relative or remote https url imports, you can skip your build step and reference your source code as if it were a bundled ESM JavaScript module, simply by prefixing the entry point source url with https://esb.deno.dev/
You can reference just parts of public npm libraries (provided they have no package.json deps), create bundles on the fly for any commit hash, branch, or tag.
Deno folks can use this as a deno bundle
that also supports minification and treeshaking.
In addition to GETting our magic prefix urls, you can also provide local input via an http POST call.
This service is provided as a useful tool for anyone to use - the intention is to use scalable edge platforms like Deno Deploy to minimize costs and operational headaches.
Hope it helps!
- John
In general, take the url to your input file and prefix it with https://esb.deno.dev/ to build with the default options.
Set custom options using comma-separated name=value pairs as the first path segment. If a value is unspecified for a boolean option, it is assumed to be true.
Send your input in the request body to https://esb.deno.dev/ to build with the default options.
Set custom options using comma-separated name=value pairs as the first path segment. If a value is unspecified for a boolean option, it is assumed to be true.
When bundling, local relative imports will be resolved against the initial url. Full remote import urls (e.g. in Deno code) will be followed as well.
Bare references to Node packages are not supported and will fail, since we'd have to find the package json and do full Node package resolution and NPM library extraction in the scope of a single request, which is a little much.
Output is returned with the most permissive CORS header, so it can be hot-linked directly from any other domain.
By default, no cache headers are set on the response, but if the input url looks immutable (like a github commit hash or release tag), it will be returned with cache-control: public, max-age=604800, immutable so browsers can cache the result.
No per-region caching yet, but will be implemented soon in the Cloudflare version. Edge caching in the Deno Deploy version will be implemented once a cache feature is available.
In addition to minification, esbuild also performs treeshaking by default (neither are supported in deno bundle
).
Paste the browser url for any github source file, we'll redirect to the underlying raw.githubusercontent.com file.
We'll consider this output immutable and serve up immutable cache headers in the response.