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

committed by
Victor Berchet

parent
8cb1046ce9
commit
979657989b
@ -6,53 +6,11 @@
|
||||
* found in the LICENSE file at https://angular.io/license
|
||||
*/
|
||||
|
||||
import {ResourceLoader, platformCoreDynamic} from '@angular/compiler';
|
||||
import {COMPILER_OPTIONS, ClassProvider, ExistingProvider, FactoryProvider, PlatformRef, Provider, TypeProvider, ValueProvider, createPlatformFactory} from '@angular/core';
|
||||
import {WORKER_SCRIPT, platformWorkerUi} from '@angular/platform-browser';
|
||||
|
||||
import {INTERNAL_BROWSER_DYNAMIC_PLATFORM_PROVIDERS} from './src/platform_providers';
|
||||
import {CachedResourceLoader} from './src/resource_loader/resource_loader_cache';
|
||||
import {ResourceLoaderImpl} from './src/resource_loader/resource_loader_impl';
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @experimental
|
||||
* @module
|
||||
* @description
|
||||
* Entry point for all public APIs of the platform-browser-dynamic package.
|
||||
*/
|
||||
export const RESOURCE_CACHE_PROVIDER: Provider[] =
|
||||
[{provide: ResourceLoader, useClass: CachedResourceLoader}];
|
||||
export * from './src/platform-browser-dynamic';
|
||||
|
||||
/**
|
||||
* @stable
|
||||
*/
|
||||
export const platformBrowserDynamic = createPlatformFactory(
|
||||
platformCoreDynamic, 'browserDynamic', INTERNAL_BROWSER_DYNAMIC_PLATFORM_PROVIDERS);
|
||||
|
||||
/**
|
||||
* Bootstraps the worker ui.
|
||||
*
|
||||
* @experimental WebWorker support is currently 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 WebWorker support is currently experimental
|
||||
*/
|
||||
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 : [];
|
||||
}
|
||||
// This file only reexports content of the `src` folder. Keep it that way.
|
||||
|
Reference in New Issue
Block a user