Skip to content

Commit f0e2b7e

Browse files
committed
fix: revert dtsEmitPath generate logic
1 parent 2820e28 commit f0e2b7e

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

packages/plugin-dts/src/index.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -113,11 +113,10 @@ export const pluginDts = (options: PluginDtsOptions = {}): RsbuildPlugin => ({
113113
const { options: rawCompilerOptions } = tsConfigResult;
114114
const { declarationDir, outDir, composite, incremental } =
115115
rawCompilerOptions;
116+
// the priority of dtsEmitPath is dts.distPath > declarationDir > output.distPath.root
117+
// outDir is not considered since in multiple formats, the dts files may not in the same directory as the js files
116118
const dtsEmitPath =
117-
options.distPath ??
118-
declarationDir ??
119-
outDir ??
120-
config.output?.distPath?.root;
119+
options.distPath ?? declarationDir ?? config.output?.distPath?.root;
121120

122121
// check whether declarationDir or outDir is outside from current project
123122
warnIfOutside(cwd, declarationDir, 'declarationDir');

0 commit comments

Comments
 (0)