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
@ -113,7 +113,7 @@ export class AotCompiler {
|
||||
compMeta.template !.styleUrls.forEach((styleUrl) => {
|
||||
const normalizedUrl = this._host.resourceNameToFileName(styleUrl, file.fileName);
|
||||
if (!normalizedUrl) {
|
||||
throw new Error(`Couldn't resolve resource ${styleUrl} relative to ${file.fileName}`);
|
||||
throw syntaxError(`Couldn't resolve resource ${styleUrl} relative to ${file.fileName}`);
|
||||
}
|
||||
const needsShim = (compMeta.template !.encapsulation ||
|
||||
this._config.defaultEncapsulation) === ViewEncapsulation.Emulated;
|
||||
|
Reference in New Issue
Block a user