Skip to content

Commit 5a926ee

Browse files
committed
chore: update
1 parent 9b0dc60 commit 5a926ee

File tree

1 file changed

+5
-11
lines changed

1 file changed

+5
-11
lines changed

packages/plugin-dts/src/dts.ts

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import {
44
dirname,
55
isAbsolute,
66
join,
7+
normalize,
78
relative,
89
resolve,
910
} from 'node:path';
@@ -147,21 +148,14 @@ export async function generateDts(data: DtsGenOptions): Promise<void> {
147148
throw Error(`Can not set "dts.bundle: true" when "dts.build = true"`);
148149
}
149150

150-
console.log(
151-
'rawCompilerOptions.declarationDir: ',
152-
rawCompilerOptions.declarationDir,
153-
);
154-
console.log(
155-
'resolve(dirname(configPath), outDir): ',
156-
resolve(dirname(configPath), outDir),
157-
);
158151
// can not set '--declarationDir' or '--outDir' when 'build: true'.
159152
if (
160153
(!rawCompilerOptions.outDir ||
161-
rawCompilerOptions.outDir !== resolve(dirname(configPath), outDir)) &&
154+
normalize(rawCompilerOptions.outDir) !==
155+
normalize(resolve(dirname(configPath), outDir))) &&
162156
(!rawCompilerOptions.declarationDir ||
163-
rawCompilerOptions.declarationDir !==
164-
resolve(dirname(configPath), outDir))
157+
normalize(rawCompilerOptions.declarationDir) !==
158+
normalize(resolve(dirname(configPath), outDir)))
165159
) {
166160
const info =
167161
rawCompilerOptions.outDir && !rawCompilerOptions.declarationDir

0 commit comments

Comments
 (0)