deno bundle
deno bundle is currently an experimental subcommand and is subject to changes.deno bundle combines your module and all of its dependencies into a single
JavaScript file.
Basic usage Jump to heading
deno bundle main.ts output.js
The output file can then be run with Deno or in other JavaScript runtimes:
deno run output.js
For more on bundling strategies with Deno, see the Bundling guide.
deno bundle [OPTIONS] [file]...Output a single JavaScript file with all dependencies.
deno bundle jsr:@std/http/file-server -o file-server.bundle.js
If no output file is given, the output is written to standard output:
deno bundle jsr:@std/http/file-server
Type checking options Jump to heading
--check<CHECK_TYPE>optionalEnable type-checking. This subcommand does not type-check by default If the value of "all" is supplied, remote modules will be included. Alternatively, the 'deno check' subcommand can be used.
--no-check<NO_CHECK_TYPE>optionalSkip type-checking. If the value of "remote" is supplied, diagnostic errors from remote modules will be ignored.
Dependency management options Jump to heading
--frozen<BOOLEAN>optionalError out if lockfile is out of date.
Load import map file from local file or remote URL.
--lock<FILE>optionalCheck the specified lock file. (If value is not provided, defaults to "./deno.lock").
--no-lockDisable auto discovery of the lock file.
--no-npmDo not resolve npm modules.
--no-remoteDo not resolve remote modules.
--node-modules-dir<MODE>optionalSets the node modules management mode for npm packages.
--reload, -r<CACHE_BLOCKLIST>optionalReload source code cache (recompile TypeScript) no value Reload everything jsr:@std/http/file-server,jsr:@std/assert/assert-equals Reloads specific modules npm: Reload all npm modules npm:chalk Reload specific npm module.
--vendor<vendor>optionalToggles local vendor folder usage for remote modules and a node_modules folder for npm packages.
Options Jump to heading
--allow-import, -I<IP_OR_HOSTNAME>optionalAllow importing from remote hosts. Optionally specify allowed IP addresses and host names, with ports as necessary. Default value: deno.land:443,jsr.io:443,esm.sh:443,raw.esm.sh:443,cdn.jsdelivr.net:443,raw.githubusercontent.com:443,gist.githubusercontent.com:443.
--allow-scripts<PACKAGE>optionalAllow running npm lifecycle scripts for the given packages
Note: Scripts will only be executed when using a node_modules directory (--node-modules-dir).
--cert<FILE>Load certificate authority from PEM encoded file.
--code-splittingEnable code splitting.
--conditions<conditions>Use this argument to specify custom conditions for npm package exports. You can also use DENO_CONDITIONS env var. .
Configure different aspects of deno including TypeScript, linting, and code formatting.
Typically the configuration file will be called deno.json or deno.jsonc and
automatically detected; in that case this flag is not necessary.
--deny-import<IP_OR_HOSTNAME>optionalDeny importing from remote hosts. Optionally specify denied IP addresses and host names, with ports as necessary.
--external<external>--format<format>--inline-imports<inline-imports>optionalWhether to inline imported modules into the importing file [default: true]
--keep-namesKeep function and class names.
--minifyMinify the output.
--minimum-dependency-age<minimum-dependency-age>(Unstable) The age in minutes, ISO-8601 duration or RFC3339 absolute timestamp (e.g. '120' for two hours, 'P2D' for two days, '2025-09-16' for cutoff date, '2025-09-16T12:00:00+00:00' for cutoff time, '0' to disable).
--no-configDisable automatic loading of the configuration file.
--outdir<outdir>Output directory for bundled files.
--output, -o<output>Output path`.
--packages<packages>How to handle packages. Accepted values are 'bundle' or 'external'.
--platform<platform>Platform to bundle for. Accepted values are 'browser' or 'deno'.
--sourcemap<sourcemap>optionalGenerate source map. Accepted values are 'linked', 'inline', or 'external'.
--watchWatch and rebuild on changes.