diff --git a/docs/bundler/index.md b/docs/bundler/index.md index a4f6b9d39c..f9c420ed2e 100644 --- a/docs/bundler/index.md +++ b/docs/bundler/index.md @@ -401,6 +401,7 @@ await Bun.build({ format: "iife", }) ``` + ```bash#CLI $ bun build ./index.tsx --outdir ./out --format iife ``` @@ -430,6 +431,7 @@ await Bun.build({ globalName: "MyLibrary", }) ``` + ```bash#CLI $ bun build ./index.tsx --outdir ./out --format iife --global-name MyLibrary ``` diff --git a/packages/bun-types/bun.d.ts b/packages/bun-types/bun.d.ts index 366ee1db0f..ff64f7b7f7 100644 --- a/packages/bun-types/bun.d.ts +++ b/packages/bun-types/bun.d.ts @@ -1837,11 +1837,11 @@ declare module "bun" { /** * Global variable name for IIFE format bundles. - * + * * When using `format: "iife"` with a `globalName`, the bundle will be * wrapped in an IIFE and the exported values will be assigned to a global * variable with the specified name. - * + * * @example * ```ts * await Bun.build({ @@ -1851,7 +1851,7 @@ declare module "bun" { * outfile: './dist/library.js' * }); * ``` - * + * * The `globalName` must be a valid JavaScript identifier. * This option is only meaningful when `format` is set to `"iife"`. */