fix(packages): use ES modules for primary build (#11120)
This commit is contained in:

committed by
Victor Berchet

parent
8cb1046ce9
commit
979657989b
@ -0,0 +1,59 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright Google Inc. All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by an MIT-style license that can be
|
||||
* found in the LICENSE file at https://angular.io/license
|
||||
*/
|
||||
|
||||
import {ResourceLoader, platformCoreDynamic} from '@angular/compiler';
|
||||
import {ApplicationRef, COMPILER_OPTIONS, CUSTOM_ELEMENTS_SCHEMA, ClassProvider, CompilerFactory, CompilerOptions, ComponentRef, ExistingProvider, FactoryProvider, NgModule, PlatformRef, Provider, Type, TypeProvider, ValueProvider, createPlatformFactory} from '@angular/core';
|
||||
import {BrowserModule, WORKER_SCRIPT, WorkerAppModule, platformWorkerUi} from '@angular/platform-browser';
|
||||
|
||||
import {INTERNAL_BROWSER_DYNAMIC_PLATFORM_PROVIDERS} from './platform_providers';
|
||||
import {Console} from './private_import_core';
|
||||
import {CachedResourceLoader} from './resource_loader/resource_loader_cache';
|
||||
import {ResourceLoaderImpl} from './resource_loader/resource_loader_impl';
|
||||
|
||||
export * from './private_export';
|
||||
|
||||
/**
|
||||
* @experimental
|
||||
*/
|
||||
export const RESOURCE_CACHE_PROVIDER: Provider[] =
|
||||
[{provide: ResourceLoader, useClass: CachedResourceLoader}];
|
||||
|
||||
/**
|
||||
* @experimental API related to bootstrapping are still under review.
|
||||
*/
|
||||
export const platformBrowserDynamic = createPlatformFactory(
|
||||
platformCoreDynamic, 'browserDynamic', INTERNAL_BROWSER_DYNAMIC_PLATFORM_PROVIDERS);
|
||||
|
||||
/**
|
||||
* Bootstraps the worker ui.
|
||||
*
|
||||
* @experimental
|
||||
*/
|
||||
export function bootstrapWorkerUi(
|
||||
workerScriptUri: string, customProviders: Provider[] = []): Promise<PlatformRef> {
|
||||
// For now, just creates the worker ui platform...
|
||||
return Promise.resolve(platformWorkerUi(([{
|
||||
provide: WORKER_SCRIPT,
|
||||
useValue: workerScriptUri,
|
||||
}] as Provider[])
|
||||
.concat(customProviders)));
|
||||
}
|
||||
|
||||
/**
|
||||
* @experimental API related to bootstrapping are still under review.
|
||||
*/
|
||||
export const platformWorkerAppDynamic = createPlatformFactory(
|
||||
platformCoreDynamic, 'workerAppDynamic', [{
|
||||
provide: COMPILER_OPTIONS,
|
||||
useValue: {providers: [{provide: ResourceLoader, useClass: ResourceLoaderImpl}]},
|
||||
multi: true
|
||||
}]);
|
||||
|
||||
function normalizeArray(arr: any[]): any[] {
|
||||
return arr ? arr : [];
|
||||
}
|
@ -9,7 +9,7 @@
|
||||
import {ResourceLoader} from '@angular/compiler';
|
||||
import {COMPILER_OPTIONS, Provider} from '@angular/core';
|
||||
|
||||
import {INTERNAL_BROWSER_PLATFORM_PROVIDERS} from '../platform_browser_private';
|
||||
import {INTERNAL_BROWSER_PLATFORM_PROVIDERS} from './private_import_platform-browser';
|
||||
|
||||
import {ResourceLoaderImpl} from './resource_loader/resource_loader_impl';
|
||||
|
||||
|
@ -0,0 +1,15 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright Google Inc. All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by an MIT-style license that can be
|
||||
* found in the LICENSE file at https://angular.io/license
|
||||
*/
|
||||
import {ClassProvider, ExistingProvider, FactoryProvider, Provider, TypeProvider, ValueProvider} from '@angular/core';
|
||||
import {INTERNAL_BROWSER_DYNAMIC_PLATFORM_PROVIDERS} from './platform_providers';
|
||||
|
||||
export var __platform_browser_dynamic_private__: {
|
||||
INTERNAL_BROWSER_DYNAMIC_PLATFORM_PROVIDERS: typeof INTERNAL_BROWSER_DYNAMIC_PLATFORM_PROVIDERS;
|
||||
} = {
|
||||
INTERNAL_BROWSER_DYNAMIC_PLATFORM_PROVIDERS: INTERNAL_BROWSER_DYNAMIC_PLATFORM_PROVIDERS
|
||||
};
|
@ -0,0 +1,13 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright Google Inc. All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by an MIT-style license that can be
|
||||
* found in the LICENSE file at https://angular.io/license
|
||||
*/
|
||||
|
||||
import {__core_private__ as r} from '@angular/core';
|
||||
|
||||
export var ReflectionCapabilities: typeof r.ReflectionCapabilities = r.ReflectionCapabilities;
|
||||
export var reflector: typeof r.reflector = r.reflector;
|
||||
export var Console: typeof r.Console = r.Console;
|
@ -0,0 +1,13 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright Google Inc. All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by an MIT-style license that can be
|
||||
* found in the LICENSE file at https://angular.io/license
|
||||
*/
|
||||
|
||||
import {__platform_browser_private__ as _} from '@angular/platform-browser';
|
||||
|
||||
export var INTERNAL_BROWSER_PLATFORM_PROVIDERS: typeof _.INTERNAL_BROWSER_PLATFORM_PROVIDERS =
|
||||
_.INTERNAL_BROWSER_PLATFORM_PROVIDERS;
|
||||
export var getDOM: typeof _.getDOM = _.getDOM;
|
Reference in New Issue
Block a user