fix(compiler): don’t use ng:// in AOT source maps, and never point to the original source file

This is important to not confuse users nor downstream tools that
consume our source maps. For generated content for which we don’t
have an original source file, we use the generated file now.

Fixes #19538
This commit is contained in:
Tobias Bosch
2017-10-04 13:37:27 -07:00
committed by Alex Rickabaugh
parent 5b5108363d
commit 01f711281c
16 changed files with 42 additions and 56 deletions

View File

@ -287,7 +287,7 @@ export class TsCompilerAotCompilerTypeCheckHostAdapter extends
`Invalid Argument: Expected a GenerateFile with statements. ${genFile.genFileUrl}`);
}
const {sourceText, context} = this.emitter.emitStatementsAndContext(
genFile.srcFileUrl, genFile.genFileUrl, genFile.stmts, /* preamble */ '',
genFile.genFileUrl, genFile.stmts, /* preamble */ '',
/* emitSourceMaps */ false);
const sf = ts.createSourceFile(
genFile.genFileUrl, sourceText, this.options.target || ts.ScriptTarget.Latest);