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) {