cloudflare · Cloudflare Workers Docs
Workers Bundling
Explains how Wrangler uses esbuild to bundle Worker code, how to handle non-JavaScript modules like Wasm or text files, and how to configure module inclusion and custom build processes.
Derived skill
Files assembled from official documentation
Viewing SKILL.md
Workers Bundling
Explains how Wrangler uses esbuild to bundle Worker code, how to handle non-JavaScript modules like Wasm or text files, and how to configure module inclusion and custom build processes.
When To Use
Use when you need to configure how Wrangler bundles npm modules, include non-JavaScript assets like .wasm or .sql files, or implement custom build steps before deployment.
Reference Files
| File | Contains | Use For |
|---|---|---|
SKILL.md | Entry point: scope, routing table, and workflow. | Start here. |
docs/workers-wrangler-bundling-workflow-guide.md | A guide explaining how Wrangler uses esbuild to bundle Worker code, including support for npm modules, NODE_ENV, and conditional exports. | Questions about a guide explaining how Wrangler uses esbuild to bundle Worker code, including support for npm modules, NODEENV, and c... |
examples/workers-wrangler-bundling-cloudflare-workers-wrangler-bundling-import.text | A text file demonstrating how to import a local text file into a Cloudflare Worker using Wrangler bundling. | Exact payloads, commands, or snippets shown in A text file demonstrating how to import a local text file into a Cloudflare Worker using Wrangler bundling. |
examples/workers-wrangler-bundling-cloudflare-workers-wrangler-wasm-module-import.text | A JavaScript code example demonstrating how to import and instantiate a WebAssembly module within a Cloudflare Workers script using Wrangler bundling. | Exact payloads, commands, or snippets shown in A JavaScript code example demonstrating how to import and instantiate a WebAssembly module within a Cloudflare Worker... |
examples/workers-wrangler-bundling-cloudflare-workers-wrangler-bundling-developme.text | A code snippet demonstrating how to use process.env.NODE_ENV to conditionally execute logic during a Cloudflare Workers bundling process. | Exact payloads, commands, or snippets shown in A code snippet demonstrating how to use process.env.NODEENV to conditionally execute logic during a Cloudflare Worker... |
examples/workers-wrangler-bundling-cloudflare-workers-wrangler-bundling-dev-comma.text | A text example demonstrating the use of the NODE_ENV=staging environment variable with the npx wrangler dev command for Workers bundling. | Exact payloads, commands, or snippets shown in A text example demonstrating the use of the NODEENV=staging environment variable with the npx wrangler dev command fo... |
examples/workers-wrangler-bundling-cloudflare-workers-wrangler-bundling-dev-comma-2.text | A text example demonstrating the use of the NODE_ENV environment variable with the wrangler dev command for Workers bundling. | Exact payloads, commands, or snippets shown in A text example demonstrating the use of the NODEENV environment variable with the wrangler dev command for Workers bu... |
examples/workers-wrangler-bundling-cloudflare-workers-wrangler-bundling-dev-comma-3.text | A text example demonstrating the use of the NODE_ENV environment variable with the pnpm wrangler dev command for Workers bundling. | Exact payloads, commands, or snippets shown in A text example demonstrating the use of the NODEENV environment variable with the pnpm wrangler dev command for Worke... |
What This Skill Covers
- By default, Wrangler bundles your Worker code using esbuild ↗. This means that Wrangler has built-in support for importing modules from npm ↗ defined in your...
- Main sections:
Including non-JavaScript modules,Find additional modules,NODEENV,Conditional exports,Disable bundling.
Workflow
- Open the most relevant file under
docs/for the exact documented workflow and wording. - Open
schemas/files for exact structured contracts. - Open
examples/files for concrete requests, commands, snippets, and manifests. - Do not add behavior or configuration that is not present in the attached source files.
Canonical source: https://developers.cloudflare.com/workers/wrangler/bundling
