]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blob - client/src/main.ts
Move to sass module
[github/Chocobozzz/PeerTube.git] / client / src / main.ts
1 import { ApplicationRef, enableProdMode } from '@angular/core'
2 import { enableDebugTools } from '@angular/platform-browser'
3 import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'
4 import { AppModule } from './app/app.module'
5 import { environment } from './environments/environment'
6
7 if (environment.production) {
8 enableProdMode()
9 }
10
11 const bootstrap = () => platformBrowserDynamic()
12 .bootstrapModule(AppModule)
13 .then(bootstrapModule => {
14 if (!environment.production) {
15 const applicationRef = bootstrapModule.injector.get(ApplicationRef)
16 const componentRef = applicationRef.components[0]
17
18 // allows to run `ng.profiler.timeChangeDetection();`
19 enableDebugTools(componentRef)
20 }
21
22 return bootstrapModule
23 })
24 .catch(err => {
25 console.error(err)
26 return null
27 })
28
29 bootstrap()