Options (1)
-e, --externalbooleanBundle with external dependencies not included in the output
Example:
bun build {{path/to/entry.ts}} --outfile {{path/to/output.js}} {{[-e|--external]}} {{react react-dom}}Examples (8)
Bundle an entry point to a single output file
bun build path/to/entry.ts --outfile path/to/output.jsBundle multiple entry points to an output directory
bun build path/to/entry1.ts path/to/entry2.ts ... --outdir path/to/distBundle with source maps for debugging
bun build path/to/entry.ts --outfile path/to/output.js --sourcemapBundle with minification for production
bun build path/to/entry.ts --outfile path/to/output.js --minifyBundle with a specific target environment
bun build path/to/entry.ts --outfile path/to/output.js --target browser|bun|nodeBundle to a standalone executable
bun build path/to/entry.ts --compile --outfile path/to/executableWatch for file changes and rebuild automatically
bun build path/to/entry.ts --outfile path/to/output.js --watchBundle with external dependencies not included in the output
bun build path/to/entry.ts --outfile path/to/output.js [-e|--external] react react-dommade by @shridhargupta | data from tldr-pages