Skip to main content
Module

x/dnt/mod.ts>BuildOptions

Deno to npm package build tool.
Go to Latest
interface BuildOptions
import { type BuildOptions } from "https://deno.land/x/dnt@0.30.0/mod.ts";

Properties

entryPoints: (string | EntryPoint)[]

Entrypoint(s) to the Deno module. Ex. ./mod.ts

outDir: string

Directory to output to.

Shims to use.

optional
typeCheck: boolean

Type check the output.

optional
test: boolean

Collect and run test files.

optional
declaration: boolean

Create declaration files.

optional
scriptModule: "cjs" | "umd" | false

Include a CommonJS or UMD module.

optional
esModule: boolean

Whether to emit an ES module.

optional
skipSourceOutput: boolean

Skip outputting the canonical TypeScript in the output directory before emitting.

optional
rootTestDir: string

Root directory to find test files in. Defaults to the cwd.

optional
testPattern: string

Glob pattern to use to find tests files. Defaults to deno test's pattern.

optional
mappings: SpecifierMappings

Specifiers to map from and to.

This can be used to create a node specific file:

mappings: {
  "./file.deno.ts": "./file.node.ts",
}

Or map a specifier to an npm package:

mappings: {
"https://deno.land/x/code_block_writer@11.0.0/mod.ts": {
  name: "code-block-writer",
  version: "^11.0.0",
}

Package.json output. You may override dependencies and dev dependencies in here.

optional
importMap: string

Path or url to import map.

optional
packageManager:
| "npm"
| "yarn"
| "pnpm"
| string

Package manager used to install dependencies and run npm scripts. This also can be an absolute path to the executable file of package manager.

optional
compilerOptions: { importHelpers?: boolean; target?: ScriptTarget; sourceMap?: SourceMapOptions; inlineSources?: boolean; lib?: LibName[]; skipLibCheck?: boolean; }

Optional compiler options.

optional
postBuild: () => void | Promise<void>

Action to do after emitting and before running tests.