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:
Chuck Jazdzewski
2017-10-17 16:10:15 -07:00
committed by Tobias Bosch
parent 3861ba2929
commit 25cbc98979
4 changed files with 46 additions and 3 deletions

View File

@ -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;