From 676cad118f27a0583180f401bc98595846d682d0 Mon Sep 17 00:00:00 2001 From: Timeless0911 <50201324+Timeless0911@users.noreply.github.com> Date: Tue, 11 Feb 2025 19:00:31 +0800 Subject: [PATCH] fix: windows issue in dts redirect (#746) --- packages/plugin-dts/src/utils.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/plugin-dts/src/utils.ts b/packages/plugin-dts/src/utils.ts index 3f1b395ef..2a90cd524 100644 --- a/packages/plugin-dts/src/utils.ts +++ b/packages/plugin-dts/src/utils.ts @@ -243,8 +243,8 @@ export async function redirectDtsImports( let redirectImportPath = importPath; if (absoluteImportPath && redirect.path) { - const isOutsideRootdir = !absoluteImportPath.startsWith( - rootDir + path.sep, + const isOutsideRootdir = !normalize(absoluteImportPath).startsWith( + normalize(rootDir) + path.sep, ); if (isOutsideRootdir) {