fix(compiler): add an empty content for source file of non mapped code. (#15246)
Before this when using ngc, tools tried to load `ng://…<component>.ts` if `…<component>.ts` was the source file of a template. PR Close #15246
This commit is contained in:

committed by
Miško Hevery

parent
5486e5417b
commit
8415910375
@ -98,7 +98,10 @@ export class EmitterVisitorContext {
|
||||
let firstOffsetMapped = false;
|
||||
const mapFirstOffsetIfNeeded = () => {
|
||||
if (!firstOffsetMapped) {
|
||||
map.addSource(sourceFilePath).addMapping(0, sourceFilePath, 0, 0);
|
||||
// Add a single space so that tools won't try to load the file from disk.
|
||||
// Note: We are using virtual urls like `ng:///`, so we have to
|
||||
// provide a content here.
|
||||
map.addSource(sourceFilePath, ' ').addMapping(0, sourceFilePath, 0, 0);
|
||||
firstOffsetMapped = true;
|
||||
}
|
||||
};
|
||||
|
Reference in New Issue
Block a user