1 | /**
|
---|
2 | * @license
|
---|
3 | * Copyright Google LLC All Rights Reserved.
|
---|
4 | *
|
---|
5 | * Use of this source code is governed by an MIT-style license that can be
|
---|
6 | * found in the LICENSE file at https://angular.io/license
|
---|
7 | */
|
---|
8 | (function (factory) {
|
---|
9 | if (typeof module === "object" && typeof module.exports === "object") {
|
---|
10 | var v = factory(require, exports);
|
---|
11 | if (v !== undefined) module.exports = v;
|
---|
12 | }
|
---|
13 | else if (typeof define === "function" && define.amd) {
|
---|
14 | define("@angular/compiler/src/aot/compiler_factory", ["require", "exports", "@angular/compiler/src/config", "@angular/compiler/src/core", "@angular/compiler/src/directive_normalizer", "@angular/compiler/src/directive_resolver", "@angular/compiler/src/expression_parser/lexer", "@angular/compiler/src/expression_parser/parser", "@angular/compiler/src/i18n/i18n_html_parser", "@angular/compiler/src/injectable_compiler", "@angular/compiler/src/metadata_resolver", "@angular/compiler/src/ml_parser/html_parser", "@angular/compiler/src/ng_module_compiler", "@angular/compiler/src/ng_module_resolver", "@angular/compiler/src/output/ts_emitter", "@angular/compiler/src/parse_util", "@angular/compiler/src/pipe_resolver", "@angular/compiler/src/schema/dom_element_schema_registry", "@angular/compiler/src/style_compiler", "@angular/compiler/src/template_parser/template_parser", "@angular/compiler/src/view_compiler/type_check_compiler", "@angular/compiler/src/view_compiler/view_compiler", "@angular/compiler/src/aot/compiler", "@angular/compiler/src/aot/static_reflector", "@angular/compiler/src/aot/static_symbol", "@angular/compiler/src/aot/static_symbol_resolver", "@angular/compiler/src/aot/summary_resolver"], factory);
|
---|
15 | }
|
---|
16 | })(function (require, exports) {
|
---|
17 | "use strict";
|
---|
18 | Object.defineProperty(exports, "__esModule", { value: true });
|
---|
19 | exports.createAotCompiler = exports.createAotUrlResolver = void 0;
|
---|
20 | var config_1 = require("@angular/compiler/src/config");
|
---|
21 | var core_1 = require("@angular/compiler/src/core");
|
---|
22 | var directive_normalizer_1 = require("@angular/compiler/src/directive_normalizer");
|
---|
23 | var directive_resolver_1 = require("@angular/compiler/src/directive_resolver");
|
---|
24 | var lexer_1 = require("@angular/compiler/src/expression_parser/lexer");
|
---|
25 | var parser_1 = require("@angular/compiler/src/expression_parser/parser");
|
---|
26 | var i18n_html_parser_1 = require("@angular/compiler/src/i18n/i18n_html_parser");
|
---|
27 | var injectable_compiler_1 = require("@angular/compiler/src/injectable_compiler");
|
---|
28 | var metadata_resolver_1 = require("@angular/compiler/src/metadata_resolver");
|
---|
29 | var html_parser_1 = require("@angular/compiler/src/ml_parser/html_parser");
|
---|
30 | var ng_module_compiler_1 = require("@angular/compiler/src/ng_module_compiler");
|
---|
31 | var ng_module_resolver_1 = require("@angular/compiler/src/ng_module_resolver");
|
---|
32 | var ts_emitter_1 = require("@angular/compiler/src/output/ts_emitter");
|
---|
33 | var parse_util_1 = require("@angular/compiler/src/parse_util");
|
---|
34 | var pipe_resolver_1 = require("@angular/compiler/src/pipe_resolver");
|
---|
35 | var dom_element_schema_registry_1 = require("@angular/compiler/src/schema/dom_element_schema_registry");
|
---|
36 | var style_compiler_1 = require("@angular/compiler/src/style_compiler");
|
---|
37 | var template_parser_1 = require("@angular/compiler/src/template_parser/template_parser");
|
---|
38 | var type_check_compiler_1 = require("@angular/compiler/src/view_compiler/type_check_compiler");
|
---|
39 | var view_compiler_1 = require("@angular/compiler/src/view_compiler/view_compiler");
|
---|
40 | var compiler_1 = require("@angular/compiler/src/aot/compiler");
|
---|
41 | var static_reflector_1 = require("@angular/compiler/src/aot/static_reflector");
|
---|
42 | var static_symbol_1 = require("@angular/compiler/src/aot/static_symbol");
|
---|
43 | var static_symbol_resolver_1 = require("@angular/compiler/src/aot/static_symbol_resolver");
|
---|
44 | var summary_resolver_1 = require("@angular/compiler/src/aot/summary_resolver");
|
---|
45 | function createAotUrlResolver(host) {
|
---|
46 | return {
|
---|
47 | resolve: function (basePath, url) {
|
---|
48 | var filePath = host.resourceNameToFileName(url, basePath);
|
---|
49 | if (!filePath) {
|
---|
50 | throw parse_util_1.syntaxError("Couldn't resolve resource " + url + " from " + basePath);
|
---|
51 | }
|
---|
52 | return filePath;
|
---|
53 | }
|
---|
54 | };
|
---|
55 | }
|
---|
56 | exports.createAotUrlResolver = createAotUrlResolver;
|
---|
57 | /**
|
---|
58 | * Creates a new AotCompiler based on options and a host.
|
---|
59 | */
|
---|
60 | function createAotCompiler(compilerHost, options, errorCollector) {
|
---|
61 | var translations = options.translations || '';
|
---|
62 | var urlResolver = createAotUrlResolver(compilerHost);
|
---|
63 | var symbolCache = new static_symbol_1.StaticSymbolCache();
|
---|
64 | var summaryResolver = new summary_resolver_1.AotSummaryResolver(compilerHost, symbolCache);
|
---|
65 | var symbolResolver = new static_symbol_resolver_1.StaticSymbolResolver(compilerHost, symbolCache, summaryResolver);
|
---|
66 | var staticReflector = new static_reflector_1.StaticReflector(summaryResolver, symbolResolver, [], [], errorCollector);
|
---|
67 | var htmlParser;
|
---|
68 | if (!!options.enableIvy) {
|
---|
69 | // Ivy handles i18n at the compiler level so we must use a regular parser
|
---|
70 | htmlParser = new html_parser_1.HtmlParser();
|
---|
71 | }
|
---|
72 | else {
|
---|
73 | htmlParser = new i18n_html_parser_1.I18NHtmlParser(new html_parser_1.HtmlParser(), translations, options.i18nFormat, options.missingTranslation, console);
|
---|
74 | }
|
---|
75 | var config = new config_1.CompilerConfig({
|
---|
76 | defaultEncapsulation: core_1.ViewEncapsulation.Emulated,
|
---|
77 | useJit: false,
|
---|
78 | missingTranslation: options.missingTranslation,
|
---|
79 | preserveWhitespaces: options.preserveWhitespaces,
|
---|
80 | strictInjectionParameters: options.strictInjectionParameters,
|
---|
81 | });
|
---|
82 | var normalizer = new directive_normalizer_1.DirectiveNormalizer({ get: function (url) { return compilerHost.loadResource(url); } }, urlResolver, htmlParser, config);
|
---|
83 | var expressionParser = new parser_1.Parser(new lexer_1.Lexer());
|
---|
84 | var elementSchemaRegistry = new dom_element_schema_registry_1.DomElementSchemaRegistry();
|
---|
85 | var tmplParser = new template_parser_1.TemplateParser(config, staticReflector, expressionParser, elementSchemaRegistry, htmlParser, console, []);
|
---|
86 | var resolver = new metadata_resolver_1.CompileMetadataResolver(config, htmlParser, new ng_module_resolver_1.NgModuleResolver(staticReflector), new directive_resolver_1.DirectiveResolver(staticReflector), new pipe_resolver_1.PipeResolver(staticReflector), summaryResolver, elementSchemaRegistry, normalizer, console, symbolCache, staticReflector, errorCollector);
|
---|
87 | // TODO(vicb): do not pass options.i18nFormat here
|
---|
88 | var viewCompiler = new view_compiler_1.ViewCompiler(staticReflector);
|
---|
89 | var typeCheckCompiler = new type_check_compiler_1.TypeCheckCompiler(options, staticReflector);
|
---|
90 | var compiler = new compiler_1.AotCompiler(config, options, compilerHost, staticReflector, resolver, tmplParser, new style_compiler_1.StyleCompiler(urlResolver), viewCompiler, typeCheckCompiler, new ng_module_compiler_1.NgModuleCompiler(staticReflector), new injectable_compiler_1.InjectableCompiler(staticReflector, !!options.enableIvy), new ts_emitter_1.TypeScriptEmitter(), summaryResolver, symbolResolver);
|
---|
91 | return { compiler: compiler, reflector: staticReflector };
|
---|
92 | }
|
---|
93 | exports.createAotCompiler = createAotCompiler;
|
---|
94 | });
|
---|
95 | //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29tcGlsZXJfZmFjdG9yeS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uLy4uL3BhY2thZ2VzL2NvbXBpbGVyL3NyYy9hb3QvY29tcGlsZXJfZmFjdG9yeS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTs7Ozs7O0dBTUc7Ozs7Ozs7Ozs7Ozs7SUFFSCx1REFBeUM7SUFDekMsbURBQTBDO0lBQzFDLG1GQUE0RDtJQUM1RCwrRUFBd0Q7SUFDeEQsdUVBQWlEO0lBQ2pELHlFQUFtRDtJQUNuRCxnRkFBd0Q7SUFDeEQsaUZBQTBEO0lBQzFELDZFQUE2RDtJQUM3RCw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