deno bundle: Bundle Modules in CI
deno bundle produces a single JavaScript file from an entry module and its dependencies.
deno bundle has a history worth knowing before you depend on it in CI: it was deprecated in Deno 1 and removed for a time, so check your runtime version.
What it does
deno bundle resolves the module graph from an entry point and concatenates it into one self-contained JavaScript file. It was deprecated late in Deno 1.x and removed at the Deno 2 launch, then reintroduced in a later Deno 2 release; for any pipeline, pin the Deno version and confirm the subcommand exists.
Common usage
# verify availability on your pinned Deno version first
deno --version
deno bundle main.ts bundle.js
# robust alternative used during the gap: esbuild
deno run -A npm:esbuild main.ts --bundle --outfile=bundle.jsOptions
| Item | What it does |
|---|---|
| <entry> <out> | Bundle the entry module into the output file |
| --watch | Rebuild on file changes (where supported) |
| esbuild (alternative) | A bundler many projects used while deno bundle was unavailable |
In CI
Because deno bundle availability changed across releases, pin the Deno version in CI and gate on deno --version. If you target a range that includes versions without the subcommand, use a bundler like esbuild via npm: instead so the pipeline does not break on an upgrade.
Common errors in CI
"error: unrecognized subcommand 'bundle'" means your Deno version removed it; upgrade to a release that restored it or switch to esbuild. "Module not found" means the entry graph is incomplete. A deprecation warning on Deno 1.x is informational but signals future removal.