We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 95ae809 commit 478d763Copy full SHA for 478d763
1 file changed
src/compiler/utilities.ts
@@ -2330,7 +2330,9 @@ namespace ts {
2330
2331
export function getSourceFilePathInNewDir(sourceFile: SourceFile, host: EmitHost, newDirPath: string) {
2332
let sourceFilePath = getNormalizedAbsolutePath(sourceFile.fileName, host.getCurrentDirectory());
2333
- sourceFilePath = sourceFilePath.replace(host.getCommonSourceDirectory(), "");
+ const commonSourceDirectory = host.getCommonSourceDirectory();
2334
+ const isSourceFileInCommonSourceDirectory = sourceFilePath.toLowerCase().indexOf(commonSourceDirectory.toLowerCase()) === 0;
2335
+ sourceFilePath = isSourceFileInCommonSourceDirectory ? sourceFilePath.substring(commonSourceDirectory.length) : sourceFilePath;
2336
return combinePaths(newDirPath, sourceFilePath);
2337
}
2338
0 commit comments