Skip to main content

CompilerOptions

Properties

PropertyTypeDefault valueDescription

dist

string

undefined

The output directory

Example

dist: "dist";

src

string | string[]

undefined

The source file or files to compile

Example

src: "src/index.ts";

bundleDeps?

boolean

false;

If true the bundle will also include all dependencies

bundleWorkspaces?

boolean

true; // in watch mode

If true the bundle will also include all workspace dependencies.

cjsGlobals?

boolean

false;

Adds CommonJS global variables within esm bundle like:

  • __dirname - Corresponds to the directory of the generated bundle file
  • __filename - Corresponds to the file path of the generated bundle file
  • require - Corresponds to the Node.js synchronous function to import modules

esbuild?

Partial<Omit<BuildOptions, "outdir" | "entryPoints">>

undefined

Options to pass to esbuild