|
1 | 1 | import { VisitorContext } from "../types"; |
2 | | -import { isBaseDir, isURL, maybeAddRelativeLocalPrefix } from "./general-utils"; |
| 2 | +import { isBaseDir, isURL, maybeAddRelativeLocalPrefix, nativeRelativePath } from "./general-utils"; |
3 | 3 | import * as path from "path"; |
4 | 4 | import { removeFileExtension, removeSuffix, ResolvedModuleFull, SourceFile } from "typescript"; |
5 | 5 | import { getOutputDirForSourceFile } from "./ts-helpers"; |
@@ -167,12 +167,12 @@ export function resolveModuleName(context: VisitorContext, moduleName: string): |
167 | 167 |
|
168 | 168 | /* Remove base dirs to make relative to root */ |
169 | 169 | if (fileRootDir && moduleRootDir) { |
170 | | - srcFileOutputDir = path.relative(fileRootDir, srcFileOutputDir); |
171 | | - moduleFileOutputDir = path.relative(moduleRootDir, moduleFileOutputDir); |
| 170 | + srcFileOutputDir = nativeRelativePath(fileRootDir, srcFileOutputDir); |
| 171 | + moduleFileOutputDir = nativeRelativePath(moduleRootDir, moduleFileOutputDir); |
172 | 172 | } |
173 | 173 | } |
174 | 174 |
|
175 | | - const outputDir = path.relative(srcFileOutputDir, moduleFileOutputDir); |
| 175 | + const outputDir = nativeRelativePath(srcFileOutputDir, moduleFileOutputDir); |
176 | 176 |
|
177 | 177 | /* Compose final output path */ |
178 | 178 | const outputPath = maybeAddRelativeLocalPrefix(tsInstance.normalizePath(path.join(outputDir, outputBaseName))); |
|
0 commit comments