fix(compiler): correctly calculate the out path on windows (#19601)
Fixes #19543 PR Close #19601
This commit is contained in:

committed by
Chuck Jazdzewski

parent
d7eac7ee56
commit
d30ce19231
@ -495,5 +495,17 @@ describe('ng program', () => {
|
||||
const mapper = createSrcToOutPathMapper('/out', '/tmp/a/x.ts', '/a/x.js');
|
||||
expect(mapper('/tmp/b/y.js')).toBe('/out/b/y.js');
|
||||
});
|
||||
|
||||
it('should work on windows with normalized paths', () => {
|
||||
const mapper =
|
||||
createSrcToOutPathMapper('c:/tmp/out', 'c:/tmp/a/x.ts', 'c:/tmp/out/a/x.js', path.win32);
|
||||
expect(mapper('c:/tmp/b/y.js')).toBe('c:\\tmp\\out\\b\\y.js');
|
||||
});
|
||||
|
||||
it('should work on windows with non-normalized paths', () => {
|
||||
const mapper = createSrcToOutPathMapper(
|
||||
'c:\\tmp\\out', 'c:\\tmp\\a\\x.ts', 'c:\\tmp\\out\\a\\x.js', path.win32);
|
||||
expect(mapper('c:\\tmp\\b\\y.js')).toBe('c:\\tmp\\out\\b\\y.js');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
Reference in New Issue
Block a user