From 124354cba44a24e74a16a3f03091d349069f6b7d Mon Sep 17 00:00:00 2001 From: Gerrit Birkeland Date: Sun, 26 Nov 2023 14:19:36 -0700 Subject: [PATCH] Fix automatic declaration file resolution on Windows Ref: #2416 (more to do here) --- CHANGELOG.md | 1 + src/lib/models/reflections/ReflectionSymbolId.ts | 8 +++++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e520d1c33..598c0dd74 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ ### Bug Fixes +- Fixed automatic declaration file resolution on Windows, #2416. - Fixed default option values on options declared by plugins in packages mode, #2433. - `gitRevision` will now be replaced in `sourceLinkTemplate`, #2434. - Improved handling of function-modules created with `Object.assign`, #2436. diff --git a/src/lib/models/reflections/ReflectionSymbolId.ts b/src/lib/models/reflections/ReflectionSymbolId.ts index d3c861871..ee2728179 100644 --- a/src/lib/models/reflections/ReflectionSymbolId.ts +++ b/src/lib/models/reflections/ReflectionSymbolId.ts @@ -149,9 +149,11 @@ export function addInferredDeclarationMapPaths( const declDir = opts.declarationDir || opts.outDir || rootDir; for (const file of files) { - const mapFile = resolve(declDir, relative(rootDir, file)).replace( - /\.([cm]?[tj]s)x?$/, - ".d.$1", + const mapFile = normalizePath( + resolve(declDir, relative(rootDir, file)).replace( + /\.([cm]?[tj]s)x?$/, + ".d.$1", + ), ); declarationMapCache.set(mapFile, file); }