diff --git a/modules/@angular/compiler-cli/src/path_mapped_reflector_host.ts b/modules/@angular/compiler-cli/src/path_mapped_reflector_host.ts index d72eb5bf58..13423ef142 100644 --- a/modules/@angular/compiler-cli/src/path_mapped_reflector_host.ts +++ b/modules/@angular/compiler-cli/src/path_mapped_reflector_host.ts @@ -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) => {