deno bundle command bundles your project’s modules into optimized JavaScript files using esbuild.
Usage
Basic Examples
Output Options
Output file path (single entrypoint only)
Output directory path
Format Options
Output format (esm, cjs, iife)
Target platform (deno, node, browser, neutral)
Optimization Options
Minify the output
Keep function and class names when minifying
Enable code splitting for multiple entrypoints
External Dependencies
Mark packages as external (not bundled)
How to handle npm packages (bundle, external)
Source Maps
Generate source maps (linked, inline, external, none)
Advanced Options
Inline dynamic imports
Watch Mode
Watch for changes and rebuild automatically
Examples
Simple Library Bundle
Browser Bundle
Node.js Compatible Bundle
Multiple Entrypoints with Code Splitting
Development vs Production
HTML Entrypoint
Watch Mode for Development
Configuration
Bundling options can be configured indeno.json:
Output Structure
When using--outdir, the bundler creates: