fix(ngc): prepend a rootDir when assuming a file exists (#11291)
Otherwise we'll later try to resolve the file under one of the rootDirs and won't find it.
This commit is contained in:
parent
f5101782d9
commit
c31535982c
|
@ -74,7 +74,11 @@ export class PathMappedReflectorHost extends ReflectorHost {
|
|||
// If a file does not yet exist (because we compile it later), we still need to
|
||||
// assume it exists so that the `resolve` method works!
|
||||
if (!this.context.fileExists(importedFile)) {
|
||||
this.context.assumeFileExists(importedFile);
|
||||
if (this.options.rootDirs && this.options.rootDirs.length > 0) {
|
||||
this.context.assumeFileExists(path.join(this.options.rootDirs[0], importedFile));
|
||||
} else {
|
||||
this.context.assumeFileExists(importedFile);
|
||||
}
|
||||
}
|
||||
|
||||
const resolvable = (candidate: string) => {
|
||||
|
|
Loading…
Reference in New Issue