Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions packages/plugin-dts/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,11 +113,10 @@ export const pluginDts = (options: PluginDtsOptions = {}): RsbuildPlugin => ({
const { options: rawCompilerOptions } = tsConfigResult;
const { declarationDir, outDir, composite, incremental } =
rawCompilerOptions;
// the priority of dtsEmitPath is dts.distPath > declarationDir > output.distPath.root
// outDir is not considered since in multiple formats, the dts files may not in the same directory as the js files
const dtsEmitPath =
options.distPath ??
declarationDir ??
outDir ??
config.output?.distPath?.root;
options.distPath ?? declarationDir ?? config.output?.distPath?.root;

// check whether declarationDir or outDir is outside from current project
warnIfOutside(cwd, declarationDir, 'declarationDir');
Expand Down
Loading