File tree Expand file tree Collapse file tree
packages/nx-infra-plugin/src/executors/build-typescript Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -137,6 +137,17 @@ async function resolveSourceFiles(
137137 return files ;
138138}
139139
140+ function replacePathPrefix ( filePath : string , from : string , to : string ) : string {
141+ if ( isWindowsOS ( ) ) {
142+ return normalizeGlobPathForWindows ( filePath ) . replace (
143+ normalizeGlobPathForWindows ( from ) ,
144+ normalizeGlobPathForWindows ( to ) ,
145+ ) ;
146+ }
147+
148+ return filePath . replace ( from , to ) ;
149+ }
150+
140151function buildCompilerOptions (
141152 tsconfigContent : TsConfig ,
142153 tsconfigPath : string ,
@@ -178,7 +189,7 @@ async function emitWithAliasResolution(
178189 let finalContent = fileData ;
179190
180191 if ( aliasTranspileFunc && aliasPath ) {
181- const normalizedFilePath = filePath . replace ( outDir , aliasPath ) ;
192+ const normalizedFilePath = replacePathPrefix ( filePath , outDir , aliasPath ) ;
182193 finalContent = aliasTranspileFunc ( normalizedFilePath , fileData ) ;
183194 }
184195
You can’t perform that action at this time.
0 commit comments