Prompt Buddy logoPrompt Buddy

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.

Import to Prompt Buddy

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

FileContainsUse For
SKILL.mdEntry point: scope, routing table, and workflow.Start here.
docs/workers-wrangler-bundling-workflow-guide.mdA 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.textA 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.textA 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.textA 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.textA 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.textA 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.textA 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

  1. Open the most relevant file under docs/ for the exact documented workflow and wording.
  2. Open schemas/ files for exact structured contracts.
  3. Open examples/ files for concrete requests, commands, snippets, and manifests.
  4. Do not add behavior or configuration that is not present in the attached source files.

Canonical source: https://developers.cloudflare.com/workers/wrangler/bundling