Interface: DtsOptions
Defined in: src/config/types.ts:53
Extends
Options
Properties
build?
optional build?: boolean;Defined in: node_modules/.pnpm/rolldown-plugin-dts@0.27.13_@volar+typescript@2.4.28_rolldown@1.2.0_typescript@6.0.3_ty_f3c9114331e438a537fdb8f240c02f58/node_modules/rolldown-plugin-dts/dist/index.d.mts:126
Build mode for the TypeScript compiler:
- If
true, the plugin will usetsc -bto build the project and all referenced projects before emitting.d.tsfiles. - If
false, the plugin will usetscto emit.d.tsfiles without building referenced projects.
Default
falseInherited from
RolldownPluginDtsOptions.buildcjsDefault?
optional cjsDefault?: boolean;Defined in: node_modules/.pnpm/rolldown-plugin-dts@0.27.13_@volar+typescript@2.4.28_rolldown@1.2.0_typescript@6.0.3_ty_f3c9114331e438a537fdb8f240c02f58/node_modules/rolldown-plugin-dts/dist/index.d.mts:106
Determines how the default export is emitted.
If set to true, and you are only exporting a single item using export default ..., the output will use export = ... instead of the standard ES module syntax. This is useful for compatibility with CommonJS. This only controls the output format and does not enable support for CommonJS-style .d.ts input.
Inherited from
RolldownPluginDtsOptions.cjsDefaultcjsReexport?
optional cjsReexport?: boolean;Defined in: src/config/types.ts:75
When building dual ESM+CJS formats, generate a .d.cts re-export stub instead of running a full second TypeScript compilation pass.
The stub re-exports everything from the corresponding .d.mts file, ensuring CJS and ESM consumers share the same type declarations. This eliminates the TypeScript "dual module hazard" where separate .d.cts and .d.mts declarations cause TS2352 ("neither type sufficiently overlaps") errors when casting between types derived from the same class.
Only applies when building both esm and cjs formats simultaneously.
Remarks
The generated .d.cts stub uses a relative path to re-export from the corresponding .d.mts file, so both formats must be emitted to the same outDir. Splitting CJS and ESM outputs into separate format-specific directories (e.g. dist/cjs and dist/esm) is not supported with this option, because the re-export path would be invalid.
Default
falsecompilerOptions?
optional compilerOptions?: CompilerOptions;Defined in: node_modules/.pnpm/rolldown-plugin-dts@0.27.13_@volar+typescript@2.4.28_rolldown@1.2.0_typescript@6.0.3_ty_f3c9114331e438a537fdb8f240c02f58/node_modules/rolldown-plugin-dts/dist/index.d.mts:83
Override the compilerOptions specified in tsconfig.json.
See
https://www.typescriptlang.org/tsconfig/#compilerOptions
Inherited from
RolldownPluginDtsOptions.compilerOptionscwd?
optional cwd?: string;Defined in: node_modules/.pnpm/rolldown-plugin-dts@0.27.13_@volar+typescript@2.4.28_rolldown@1.2.0_typescript@6.0.3_ty_f3c9114331e438a537fdb8f240c02f58/node_modules/rolldown-plugin-dts/dist/index.d.mts:50
The directory in which the plugin will search for the tsconfig.json file.
Inherited from
RolldownPluginDtsOptions.cwddtsInput?
optional dtsInput?: boolean;Defined in: node_modules/.pnpm/rolldown-plugin-dts@0.27.13_@volar+typescript@2.4.28_rolldown@1.2.0_typescript@6.0.3_ty_f3c9114331e438a537fdb8f240c02f58/node_modules/rolldown-plugin-dts/dist/index.d.mts:56
Set to true if your entry files are .d.ts files instead of .ts files.
When enabled, the plugin will skip generating a .d.ts file for the entry point.
Inherited from
RolldownPluginDtsOptions.dtsInputeager?
optional eager?: boolean;Defined in: node_modules/.pnpm/rolldown-plugin-dts@0.27.13_@volar+typescript@2.4.28_rolldown@1.2.0_typescript@6.0.3_ty_f3c9114331e438a537fdb8f240c02f58/node_modules/rolldown-plugin-dts/dist/index.d.mts:171
If true, the plugin will prepare all files listed in tsconfig.json for tsc or vue-tsc.
This is especially useful when you have a single tsconfig.json for multiple projects in a monorepo.
Inherited from
RolldownPluginDtsOptions.eageremitDtsOnly?
optional emitDtsOnly?: boolean;Defined in: node_modules/.pnpm/rolldown-plugin-dts@0.27.13_@volar+typescript@2.4.28_rolldown@1.2.0_typescript@6.0.3_ty_f3c9114331e438a537fdb8f240c02f58/node_modules/rolldown-plugin-dts/dist/index.d.mts:62
If true, the plugin will emit only .d.ts files and remove all other output chunks.
This is especially useful when generating .d.ts files for the CommonJS format as part of a separate build step.
Inherited from
RolldownPluginDtsOptions.emitDtsOnlyemitJs?
optional emitJs?: boolean;Defined in: node_modules/.pnpm/rolldown-plugin-dts@0.27.13_@volar+typescript@2.4.28_rolldown@1.2.0_typescript@6.0.3_ty_f3c9114331e438a537fdb8f240c02f58/node_modules/rolldown-plugin-dts/dist/index.d.mts:191
If true, the plugin will emit .d.ts files for .js files as well. This is useful when you want to generate type definitions for JavaScript files with JSDoc comments.
Enabled by default when allowJs in compilerOptions is true. This option is only used when Options.oxc is false.
Inherited from
RolldownPluginDtsOptions.emitJsentry?
optional entry?: string | string[];Defined in: node_modules/.pnpm/rolldown-plugin-dts@0.27.13_@volar+typescript@2.4.28_rolldown@1.2.0_typescript@6.0.3_ty_f3c9114331e438a537fdb8f240c02f58/node_modules/rolldown-plugin-dts/dist/index.d.mts:46
Glob pattern(s) to filter which entry files get .d.ts generation.
When specified, only entry files matching these patterns will emit .d.ts chunks. When not specified, all entries get .d.ts generation.
Supports negation patterns (e.g., ['**', '!src/icons/**']) for exclusion. Patterns are matched against file paths relative to cwd.
Example
entry: 'src/index.ts'
entry: ['src/*.ts', '!src/internal/**']Inherited from
RolldownPluginDtsOptions.entrygenerator?
optional generator?: "oxc" | "tsgo" | "tsc";Defined in: node_modules/.pnpm/rolldown-plugin-dts@0.27.13_@volar+typescript@2.4.28_rolldown@1.2.0_typescript@6.0.3_ty_f3c9114331e438a537fdb8f240c02f58/node_modules/rolldown-plugin-dts/dist/index.d.mts:32
The generator used to produce .d.ts files.
'tsc': The TypeScript 5.x/6.x compiler. Supports all TypeScript features.'oxc': Oxc's isolated declaration generator. Much faster thantsc, but only supports code that satisfiesisolatedDeclarations.'tsgo': [Experimental] The TypeScript Go compiler (tsgo). May not support all TypeScript features yet.
When unset, the generator is inferred:
'oxc'if oxc options are provided orisolatedDeclarationsis enabled incompilerOptions.'tsgo'if TypeScript 7.0 (or@typescript/native-preview) is installed, or tsgo options are provided.'tsc'otherwise, and always when vue is enabled.
Default
'tsc'Inherited from
RolldownPluginDtsOptions.generatorincremental?
optional incremental?: boolean;Defined in: node_modules/.pnpm/rolldown-plugin-dts@0.27.13_@volar+typescript@2.4.28_rolldown@1.2.0_typescript@6.0.3_ty_f3c9114331e438a537fdb8f240c02f58/node_modules/rolldown-plugin-dts/dist/index.d.mts:156
If your tsconfig.json has references option, rolldown-plugin-dts will use tsc -b to build the project and all referenced projects before emitting .d.ts files.
In such case, if this option is true, rolldown-plugin-dts will write down all built files into your disk, including .tsbuildinfo and other built files. This is equivalent to running tsc -b in your project.
Otherwise, if this option is false, rolldown-plugin-dts will write built files only into memory and leave a small footprint in your disk.
Enabling this option will decrease the build time by caching previous build results. This is helpful when you have a large project with multiple referenced projects.
By default, incremental is true if your tsconfig has incremental or tsBuildInfoFile enabled.
This option is only used when Options.oxc is false.
Inherited from
RolldownPluginDtsOptions.incrementallogger?
optional logger?: Logger;Defined in: node_modules/.pnpm/rolldown-plugin-dts@0.27.13_@volar+typescript@2.4.28_rolldown@1.2.0_typescript@6.0.3_ty_f3c9114331e438a537fdb8f240c02f58/node_modules/rolldown-plugin-dts/dist/index.d.mts:115
Inherited from
RolldownPluginDtsOptions.loggernewContext?
optional newContext?: boolean;Defined in: node_modules/.pnpm/rolldown-plugin-dts@0.27.13_@volar+typescript@2.4.28_rolldown@1.2.0_typescript@6.0.3_ty_f3c9114331e438a537fdb8f240c02f58/node_modules/rolldown-plugin-dts/dist/index.d.mts:182
If true, the plugin will create a new isolated context for each build, ensuring that previously generated .d.ts code and caches are not reused.
By default, the plugin may reuse internal caches or incremental build artifacts to speed up repeated builds. Enabling this option forces a clean context, guaranteeing that all type definitions are generated from scratch.
Default
falseInherited from
RolldownPluginDtsOptions.newContextoxc?
optional oxc?: boolean | Omit<IsolatedDeclarationsOptions, "sourcemap">;Defined in: node_modules/.pnpm/rolldown-plugin-dts@0.27.13_@volar+typescript@2.4.28_rolldown@1.2.0_typescript@6.0.3_ty_f3c9114331e438a537fdb8f240c02f58/node_modules/rolldown-plugin-dts/dist/index.d.mts:200
If true, the plugin will generate .d.ts files using Oxc, which is significantly faster than the TypeScript compiler.
This option is automatically enabled when isolatedDeclarations in compilerOptions is set to true.
Inherited from
RolldownPluginDtsOptions.oxcparallel?
optional parallel?: boolean;Defined in: node_modules/.pnpm/rolldown-plugin-dts@0.27.13_@volar+typescript@2.4.28_rolldown@1.2.0_typescript@6.0.3_ty_f3c9114331e438a537fdb8f240c02f58/node_modules/rolldown-plugin-dts/dist/index.d.mts:165
If true, the plugin will launch a separate process for tsc or vue-tsc. This enables processing multiple projects in parallel.
Inherited from
RolldownPluginDtsOptions.parallelresolver?
optional resolver?: "oxc" | "tsc";Defined in: node_modules/.pnpm/rolldown-plugin-dts@0.27.13_@volar+typescript@2.4.28_rolldown@1.2.0_typescript@6.0.3_ty_f3c9114331e438a537fdb8f240c02f58/node_modules/rolldown-plugin-dts/dist/index.d.mts:96
Specifies a resolver to resolve type definitions, especially for node_modules.
'oxc': Uses Oxc's module resolution, which is faster and more efficient.'tsc': Uses TypeScript's native module resolution, which may be more compatible with complex setups, but slower.
Default
'oxc'Inherited from
RolldownPluginDtsOptions.resolversideEffects?
optional sideEffects?: boolean;Defined in: node_modules/.pnpm/rolldown-plugin-dts@0.27.13_@volar+typescript@2.4.28_rolldown@1.2.0_typescript@6.0.3_ty_f3c9114331e438a537fdb8f240c02f58/node_modules/rolldown-plugin-dts/dist/index.d.mts:114
Indicates whether the generated .d.ts files have side effects.
- If set to
true, Rolldown will treat the.d.tsfiles as having side effects during tree-shaking. - If set to
false, Rolldown may consider the.d.tsfiles as side-effect-free, potentially removing them if they are not imported.
Default
falseInherited from
RolldownPluginDtsOptions.sideEffectssourcemap?
optional sourcemap?: boolean;Defined in: node_modules/.pnpm/rolldown-plugin-dts@0.27.13_@volar+typescript@2.4.28_rolldown@1.2.0_typescript@6.0.3_ty_f3c9114331e438a537fdb8f240c02f58/node_modules/rolldown-plugin-dts/dist/index.d.mts:87
If true, the plugin will generate declaration maps (.d.ts.map) for .d.ts files.
Inherited from
RolldownPluginDtsOptions.sourcemaptsconfig?
optional tsconfig?: string | boolean;Defined in: node_modules/.pnpm/rolldown-plugin-dts@0.27.13_@volar+typescript@2.4.28_rolldown@1.2.0_typescript@6.0.3_ty_f3c9114331e438a537fdb8f240c02f58/node_modules/rolldown-plugin-dts/dist/index.d.mts:71
The path to the tsconfig.json file.
If set to false, the plugin will ignore any tsconfig.json file. You can still specify compilerOptions directly in the options.
Default
'tsconfig.json'Inherited from
RolldownPluginDtsOptions.tsconfigtsconfigRaw?
optional tsconfigRaw?: Omit<TsConfigJson, "compilerOptions">;Defined in: node_modules/.pnpm/rolldown-plugin-dts@0.27.13_@volar+typescript@2.4.28_rolldown@1.2.0_typescript@6.0.3_ty_f3c9114331e438a537fdb8f240c02f58/node_modules/rolldown-plugin-dts/dist/index.d.mts:77
Pass a raw tsconfig.json object directly to the plugin.
See
https://www.typescriptlang.org/tsconfig
Inherited from
RolldownPluginDtsOptions.tsconfigRawtsgo?
optional tsgo?: boolean | TsgoOptions;Defined in: node_modules/.pnpm/rolldown-plugin-dts@0.27.13_@volar+typescript@2.4.28_rolldown@1.2.0_typescript@6.0.3_ty_f3c9114331e438a537fdb8f240c02f58/node_modules/rolldown-plugin-dts/dist/index.d.mts:223
[Experimental] Enables DTS generation using tsgo.
This is automatically enabled when the TypeScript Go compiler (v7+) is installed as the typescript package. Otherwise, make sure @typescript/native-preview is installed as a dependency, or provide a custom path to the tsgo binary using the path option.
Note: TypeScript 7.0 does not yet have a stable API and is experimental. This option is not yet recommended for production environments, and some options (such as tsconfigRaw and isolatedDeclarations) will be unavailable when it is enabled.
// Use tsgo from `@typescript/native-preview` dependency
tsgo: true
// Use custom tsgo path (e.g., managed by Nix)
tsgo: {
path: '/path/to/tsgo'
}Inherited from
RolldownPluginDtsOptions.tsgovolarPlugins?
optional volarPlugins?: VolarPlugin[];Defined in: node_modules/.pnpm/rolldown-plugin-dts@0.27.13_@volar+typescript@2.4.28_rolldown@1.2.0_typescript@6.0.3_ty_f3c9114331e438a537fdb8f240c02f58/node_modules/rolldown-plugin-dts/dist/index.d.mts:235
Experimental
Registers custom Volar language plugins, allowing the tsc generator to process non-standard file types (such as .vue) when generating .d.ts files. Multiple plugins can be provided and are applied together.
Enabling this option forces the tsc generator and is not supported with TypeScript 7.0.
The API may change in future versions.
Inherited from
RolldownPluginDtsOptions.volarPluginsvue?
optional vue?: boolean;Defined in: node_modules/.pnpm/rolldown-plugin-dts@0.27.13_@volar+typescript@2.4.28_rolldown@1.2.0_typescript@6.0.3_ty_f3c9114331e438a537fdb8f240c02f58/node_modules/rolldown-plugin-dts/dist/index.d.mts:160
If true, the plugin will generate .d.ts files using vue-tsc.
Inherited from
RolldownPluginDtsOptions.vue