diff --git a/src/parse-tsconfig/index.ts b/src/parse-tsconfig/index.ts index 1da91f5..3fed68a 100644 --- a/src/parse-tsconfig/index.ts +++ b/src/parse-tsconfig/index.ts @@ -1,7 +1,7 @@ import path from 'node:path'; import slash from 'slash'; import type { TsConfigJson, TsConfigJsonResolved, Cache } from '../types.js'; -import { normalizePath } from '../utils/normalize-path.js'; +import { normalizeRelativePath } from '../utils/normalize-relative-path.js'; import { readJsonc } from '../utils/read-jsonc.js'; import { implicitBaseUrlSymbol } from '../utils/symbols.js'; import { resolveExtendsPath } from './resolve-extends-path.js'; @@ -164,7 +164,7 @@ const _parseTsconfig = ( const unresolvedPath = compilerOptions[property]; if (unresolvedPath) { const resolvedBaseUrl = path.resolve(directoryPath, unresolvedPath); - const relativeBaseUrl = normalizePath(path.relative( + const relativeBaseUrl = normalizeRelativePath(path.relative( directoryPath, resolvedBaseUrl, )); @@ -181,14 +181,15 @@ const _parseTsconfig = ( if (!config.exclude.includes(outDir)) { config.exclude.push(outDir); } - compilerOptions.outDir = normalizePath(outDir); + + compilerOptions.outDir = normalizeRelativePath(outDir); } } else { config.compilerOptions = {}; } if (config.files) { - config.files = config.files.map(normalizePath); + config.files = config.files.map(normalizeRelativePath); } if (config.include) { diff --git a/src/utils/normalize-path.ts b/src/utils/normalize-relative-path.ts similarity index 79% rename from src/utils/normalize-path.ts rename to src/utils/normalize-relative-path.ts index 39948e3..2150890 100644 --- a/src/utils/normalize-path.ts +++ b/src/utils/normalize-relative-path.ts @@ -1,7 +1,7 @@ import slash from 'slash'; import { isRelativePathPattern } from './is-relative-path-pattern.js'; -export const normalizePath = (filePath: string) => { +export const normalizeRelativePath = (filePath: string) => { const normalizedPath = slash(filePath); return isRelativePathPattern.test(normalizedPath) ? normalizedPath