Bundler
Bundle TypeScript and JavaScript code, along with their dependencies, into a single file. Useful for producing self-contained scripts for distribution or deployment.
Eg Deno.bundle
Functions
f
N
Interfaces
I
I
I
I
I
I
Type Aliases
T
T
T
T
function Deno.bundle
unstable
#bundle(options: Deno.bundle.Options): Promise<Deno.bundle.Result>Bundle Typescript/Javascript code into a single file.
This is an unstable API and requires the --unstable-bundle flag to be
passed when running Deno:
deno run --unstable-bundle main.ts
const result = await Deno.bundle({
entrypoints: ["./main.ts"],
minify: true,
});
for (const file of result.outputFiles ?? []) {
console.log(file.text());
}
Parameters #
#options: Deno.bundle.Options Return Type #
Promise<Deno.bundle.Result> interface Deno.bundle.MessageNote
unstable
interface Deno.bundle.Options
unstable
Options for the bundle.
Properties #
#entrypoints: string[] The entrypoints of the bundle.
#outputPath: string optional
Output file path.
#codeSplitting: boolean optional
Whether to enable code splitting.
#inlineImports: boolean optional
Whether to inline imports.
#packages: PackageHandling optional
How to handle packages.
#sourcemap: SourceMapType optional
Source map configuration.
interface Deno.bundle.Result
unstable
type alias Deno.bundle.Format
unstable
The output format of the bundle.
Definition #
"esm"
| "cjs"
| "iife" type alias Deno.bundle.PackageHandling
unstable
How to handle packages.
bundle: packages are inlined into the bundle.external: packages are excluded from the bundle, and treated as external dependencies.
Definition #
"bundle" | "external" type alias Deno.bundle.Platform
unstable
The target platform of the bundle.
Definition #
"browser" | "deno" type alias Deno.bundle.SourceMapType
unstable
The source map type of the bundle.
Definition #
"linked"
| "inline"
| "external"