fix(ivy): ngtsc fails building flat module out on windows (#27993)
`ngtsc` currently fails building a flat module out file on Windows because it generates an invalid flat module TypeScript source file. e.g: ```ts 5 export * from './C:\Users\Paul\Desktop\test\src\export'; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ``` This is because `path.posix.relative` does not properly with non-posix paths, and only expects posix paths in order to work. PR Close #27993
This commit is contained in:

committed by
Alex Rickabaugh

parent
d336bff200
commit
070fca1591
@ -24,6 +24,7 @@ import {FactoryGenerator, FactoryInfo, GeneratedShimsHostWrapper, ShimGenerator,
|
||||
import {ivySwitchTransform} from './switch';
|
||||
import {IvyCompilation, ivyTransformFactory} from './transform';
|
||||
import {TypeCheckContext, TypeCheckProgramHost} from './typecheck';
|
||||
import {normalizeSeparators} from './util/src/path';
|
||||
import {isDtsPath} from './util/src/typescript';
|
||||
|
||||
export class NgtscProgram implements api.Program {
|
||||
@ -107,8 +108,9 @@ export class NgtscProgram implements api.Program {
|
||||
});
|
||||
} else {
|
||||
const flatModuleId = options.flatModuleId || null;
|
||||
const flatModuleOutFile = normalizeSeparators(options.flatModuleOutFile);
|
||||
this.flatIndexGenerator =
|
||||
new FlatIndexGenerator(entryPoint, options.flatModuleOutFile, flatModuleId);
|
||||
new FlatIndexGenerator(entryPoint, flatModuleOutFile, flatModuleId);
|
||||
generators.push(this.flatIndexGenerator);
|
||||
rootFiles.push(this.flatIndexGenerator.flatIndexPath);
|
||||
}
|
||||
|
Reference in New Issue
Block a user