feat(compiler): generate shallow imports compiler generated references (#14388)
This commit is contained in:

committed by
Igor Minar

parent
e4e9dbe33d
commit
8b81bb1eb6
@ -18,6 +18,7 @@ const NODE_MODULES = '/node_modules/';
|
||||
const IS_GENERATED = /\.(ngfactory|ngstyle)$/;
|
||||
const GENERATED_FILES = /\.ngfactory\.ts$|\.ngstyle\.ts$/;
|
||||
const GENERATED_OR_DTS_FILES = /\.d\.ts$|\.ngfactory\.ts$|\.ngstyle\.ts$/;
|
||||
const SHALLOW_IMPORT = /^(\w+|(\@\w+\/\w+))$/;
|
||||
|
||||
export interface CompilerHostContext extends ts.ModuleResolutionHost {
|
||||
readResource(fileName: string): Promise<string>;
|
||||
@ -133,6 +134,9 @@ export class CompilerHost implements AotCompilerHost {
|
||||
// assume that they are on top of each other.
|
||||
importedFile = importedFile.replace(this.basePath, this.genDir);
|
||||
}
|
||||
if (SHALLOW_IMPORT.test(importedFile)) {
|
||||
return importedFile;
|
||||
}
|
||||
return this.dotRelative(containingDir, importedFile);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user