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