From 68a2abd80ce0a2240d71c589c61e5b4c49f7addf Mon Sep 17 00:00:00 2001 From: Josh Wooding <12938082+joshwooding@users.noreply.github.com> Date: Wed, 14 Dec 2022 16:48:24 +0000 Subject: [PATCH] fix: use normalizePath for Windows compat (#86) Closes https://github.com/aleclarson/vite-tsconfig-paths/issues/85 --- src/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/index.ts b/src/index.ts index ba25ae3..ece2663 100644 --- a/src/index.ts +++ b/src/index.ts @@ -103,7 +103,7 @@ export default (opts: PluginOptions = {}): Plugin => { } else { const resolver = createResolver(project) if (resolver) { - const projectDir = dirname(project.tsconfigFile) + const projectDir = normalizePath(dirname(project.tsconfigFile)) const resolvers = (resolversByDir[projectDir] ||= []) resolvers.push(resolver) } @@ -146,7 +146,7 @@ export default (opts: PluginOptions = {}): Plugin => { function createResolver( project: tsconfck.TSConfckParseResult ): Resolver | null { - const configPath = project.tsconfigFile + const configPath = normalizePath(project.tsconfigFile) const config = project.tsconfig as { files?: string[] include?: string[]