From fbff4ee34b34e9976c3de472967f854f6f27f1a4 Mon Sep 17 00:00:00 2001 From: Simon Holthausen Date: Tue, 30 Jul 2024 17:02:16 +0200 Subject: [PATCH] fix: normalize paths in emitDts map bug introduced in #2443, affecting windows systems --- packages/svelte2tsx/src/emitDts.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/svelte2tsx/src/emitDts.ts b/packages/svelte2tsx/src/emitDts.ts index 78d83c302..dd76a6d45 100644 --- a/packages/svelte2tsx/src/emitDts.ts +++ b/packages/svelte2tsx/src/emitDts.ts @@ -288,11 +288,14 @@ async function createSvelteMap(config: EmitDtsConfig): Promise { version, noSvelteComponentTyped: noSvelteComponentTyped }).code; - svelteFiles.set(path, transformed); + svelteFiles.set(path.replace(/\\/g, '/'), transformed); return isTsFile; } - return { add, get: (key: string) => svelteFiles.get(key) }; + return { + add, + get: (key: string) => svelteFiles.get(key.replace(/\\/g, '/')) + }; } function isSvelteFilepath(filePath: string) {