File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -2330,7 +2330,9 @@ namespace ts {
2330
2330
2331
2331
export function getSourceFilePathInNewDir ( sourceFile : SourceFile , host : EmitHost , newDirPath : string ) {
2332
2332
let sourceFilePath = getNormalizedAbsolutePath ( sourceFile . fileName , host . getCurrentDirectory ( ) ) ;
2333
- sourceFilePath = sourceFilePath . replace ( host . getCommonSourceDirectory ( ) , "" ) ;
2333
+ const commonSourceDirectory = host . getCommonSourceDirectory ( ) ;
2334
+ const isSourceFileInCommonSourceDirectory = host . getCanonicalFileName ( sourceFilePath ) . indexOf ( host . getCanonicalFileName ( commonSourceDirectory ) ) === 0 ;
2335
+ sourceFilePath = isSourceFileInCommonSourceDirectory ? sourceFilePath . substring ( commonSourceDirectory . length ) : sourceFilePath ;
2334
2336
return combinePaths ( newDirPath , sourceFilePath ) ;
2335
2337
}
2336
2338
You can’t perform that action at this time.
0 commit comments