fix(compiler): always use ng:// prefix for sourcemap urls (#15218)

Fixes:
- In G3, filePaths don’t start with a `/` and therefore became relative.
- Always using the `ng://` prefix groups angular resources in the same
  way for AOT and JIT.
This commit is contained in:
Tobias Bosch
2017-03-16 17:33:17 -07:00
committed by Chuck Jazdzewski
parent d2fbbb44ae
commit 994089d36b
4 changed files with 49 additions and 47 deletions

View File

@ -6,7 +6,7 @@
* found in the LICENSE file at https://angular.io/license
*/
import {CompileDirectiveMetadata, CompileIdentifierMetadata, CompileNgModuleMetadata, CompileProviderMetadata, componentFactoryName, createHostComponentMeta, flatten, identifierName, templateSourceUrl} from '../compile_metadata';
import {CompileDirectiveMetadata, CompileIdentifierMetadata, CompileNgModuleMetadata, CompileProviderMetadata, componentFactoryName, createHostComponentMeta, flatten, identifierName, sourceUrl, templateSourceUrl} from '../compile_metadata';
import {CompilerConfig} from '../config';
import {Identifiers, createIdentifier, createIdentifierToken} from '../identifiers';
import {CompileMetadataResolver} from '../metadata_resolver';
@ -217,7 +217,7 @@ export class AotCompiler {
return new GeneratedFile(
srcFileUrl, genFileUrl,
this._outputEmitter.emitStatements(
srcFileUrl, genFileUrl, statements, exportedVars, this._genFilePreamble));
sourceUrl(srcFileUrl), genFileUrl, statements, exportedVars, this._genFilePreamble));
}
}