fix(metadata): Do not attach module names to metadata.
The filename contains the module name as resolved by users, so the top-level module name is uneeded. Module names on references are replaced by capturing the import syntax from the module. This allows readers of the metadata to do the module resolution themselves. Fixes #8225 Fixes #8082 Closes #8256
This commit is contained in:
@ -88,16 +88,7 @@ class DiffingTSCompiler implements DiffingBroccoliPlugin {
|
||||
this.tsServiceHost = new CustomLanguageServiceHost(this.tsOpts, this.rootFilePaths,
|
||||
this.fileRegistry, this.inputPath);
|
||||
this.tsService = ts.createLanguageService(this.tsServiceHost, ts.createDocumentRegistry());
|
||||
this.metadataCollector = new MetadataCollector({
|
||||
// Since our code isn't under a node_modules directory, we need to reverse the module
|
||||
// resolution to get metadata rooted at 'angular2'.
|
||||
// see https://github.com/angular/angular/issues/8144
|
||||
reverseModuleResolution(fileName: string) {
|
||||
if (/\.tmp\/angular2/.test(fileName)) {
|
||||
return fileName.substr(fileName.lastIndexOf('.tmp/angular2/') + 5).replace(/\.ts$/, '');
|
||||
}
|
||||
}
|
||||
});
|
||||
this.metadataCollector = new MetadataCollector();
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user