fix(compiler-cli): do not add references to files outside of rootDir
(#19770)
References to resources (such as .css files) that are generated into the `outDir` directory outside of `rootDir` would cause a spurious compiler error about not being able to find a files that ends in '.ngstyle.ts'. Also fixed a minor issue in compiler error reporting Fixes: #19765, #19767 PR Close #19770
This commit is contained in:

committed by
Tobias Bosch

parent
3861ba2929
commit
25cbc98979
@ -252,10 +252,10 @@ describe('NgCompilerHost', () => {
|
||||
it('should clear old generated references if the original host cached them', () => {
|
||||
codeGenerator.findGeneratedFileNames.and.returnValue(['/tmp/src/index.ngfactory.ts']);
|
||||
|
||||
const ngHost = createNgHost();
|
||||
const sfText = `
|
||||
/// <reference path="main.ts"/>
|
||||
`;
|
||||
const ngHost = createNgHost({files: {'tmp': {'src': {'index.ts': sfText}}}});
|
||||
const sf = ts.createSourceFile('/tmp/src/index.ts', sfText, ts.ScriptTarget.Latest);
|
||||
ngHost.getSourceFile = () => sf;
|
||||
|
||||
|
Reference in New Issue
Block a user