1 line
14 KiB
Text
1 line
14 KiB
Text
|
{"version":3,"file":"platform-browser-dynamic.mjs","sources":["../../../../../../packages/platform-browser-dynamic/src/compiler_factory.ts","../../../../../../packages/platform-browser-dynamic/src/platform_core_dynamic.ts","../../../../../../packages/platform-browser-dynamic/src/resource_loader/resource_loader_impl.ts","../../../../../../packages/platform-browser-dynamic/src/platform_providers.ts","../../../../../../packages/platform-browser-dynamic/src/resource_loader/resource_loader_cache.ts","../../../../../../packages/platform-browser-dynamic/src/version.ts","../../../../../../packages/platform-browser-dynamic/src/platform-browser-dynamic.ts","../../../../../../packages/platform-browser-dynamic/public_api.ts","../../../../../../packages/platform-browser-dynamic/index.ts","../../../../../../packages/platform-browser-dynamic/platform-browser-dynamic.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {CompilerConfig} from '@angular/compiler';\nimport {Compiler, CompilerFactory, CompilerOptions, Injector, StaticProvider, ViewEncapsulation} from '@angular/core';\n\nexport const COMPILER_PROVIDERS =\n <StaticProvider[]>[{provide: Compiler, useFactory: () => new Compiler()}];\n/**\n * @publicApi\n *\n * @deprecated\n * Ivy JIT mode doesn't require accessing this symbol.\n * See [JIT API changes due to ViewEngine deprecation](guide/deprecations#jit-api-changes) for\n * additional context.\n */\nexport class JitCompilerFactory implements CompilerFactory {\n private _defaultOptions: CompilerOptions[];\n\n /** @internal */\n constructor(defaultOptions: CompilerOptions[]) {\n const compilerOptions: CompilerOptions = {\n defaultEncapsulation: ViewEncapsulation.Emulated,\n };\n\n this._defaultOptions = [compilerOptions, ...defaultOptions];\n }\n\n createCompiler(options: CompilerOptions[] = []): Compiler {\n const opts = _mergeOptions(this._defaultOptions.concat(options));\n const injector = Injector.create({\n providers: [\n COMPILER_PROVIDERS, {\n provide: CompilerConfig,\n useFactory: () => {\n return new CompilerConfig({\n defaultEncapsulation: opts.defaultEncapsulation,\n preserveWhitespaces: opts.preserveWhitespaces,\n });\n },\n deps: []\n },\n opts.providers!\n ]\n });\n return injector.get(Compiler);\n }\n}\n\nfunction _mergeOptions(optionsArr: CompilerOptions[]): CompilerOptions {\n return {\n defaultEncapsulation: _lastDefined(optionsArr.map(options => options.defaultEncapsulation)),\n providers: _mergeArrays(optionsArr.map(options => options.providers!)),\n preserveWhitespaces: _lastDefined(optionsArr.map(options => options.preserveWhitespaces)),\n };\n}\n\nfunction _lastDefined<T>(args: T[]): T|undefined {\n for (let i = args.length - 1; i >= 0; i--) {\n if (args[i] !== undefined) {\n return args[i];\n }\n }\n return undefined;\n}\n\nfunction _mergeArrays(parts: any[][]): any[] {\n const result: any[] = [];\n parts.forEach((part) => part && result.push(...part));\n return result;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {COMPILER_OPTIONS, CompilerFactory, createPlatformFactory, platformCore} from '@angular/core';\n\nimport {JitCompilerFactory} from './compiler_factory';\n\n/**\n * A platform that included corePlatform and the compiler.\n *\n * @publicApi\n */\nexport const platformCoreDynamic = createPlatformFactory(platformCore, 'coreDynamic', [\n {provide: COMPILER_OPTIONS, useValue: {}, multi: true},\n {provide: CompilerFactory, useClass: JitCompilerFactory, deps: [COMPILER_OPTIONS]},\n]);\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of
|