-
-
Notifications
You must be signed in to change notification settings - Fork 75
Expand file tree
/
Copy pathmain.single-spa.ts
More file actions
33 lines (25 loc) · 1001 Bytes
/
main.single-spa.ts
File metadata and controls
33 lines (25 loc) · 1001 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { singleSpaAngularElements } from '@single-spa-community/angular/elements';
import { enableProdMode, getSingleSpaExtraProviders } from '@single-spa-community/angular';
import { AppModule } from './app/app.module';
import { environment } from './environments/environment';
// @ts-ignore
import unmountableStyles from './main.scss?unmountable';
if (environment.production) {
enableProdMode();
}
const lifecycles = singleSpaAngularElements({
template: '<elements-root />',
bootstrapFunction: async () => {
unmountableStyles.use();
const ngModuleRef = await platformBrowserDynamic(getSingleSpaExtraProviders()).bootstrapModule(
AppModule,
{ ngZone: 'noop' },
);
ngModuleRef.onDestroy(() => unmountableStyles.unuse());
return ngModuleRef;
},
});
export const bootstrap = lifecycles.bootstrap;
export const mount = lifecycles.mount;
export const unmount = lifecycles.unmount;