]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blame_incremental - client/src/main.ts
Fix service worker registration
[github/Chocobozzz/PeerTube.git] / client / src / main.ts
... / ...
CommitLineData
1import { enableProdMode } from '@angular/core'
2import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'
3
4import { AppModule } from './app/app.module'
5import { environment } from './environments/environment'
6
7import { hmrBootstrap } from './hmr'
8
9if (environment.production) {
10 enableProdMode()
11}
12
13const bootstrap = () => platformBrowserDynamic()
14 .bootstrapModule(AppModule)
15
16if (environment.hmr) {
17 if (module[ 'hot' ]) {
18 hmrBootstrap(module, bootstrap)
19 } else {
20 console.error('HMR is not enabled for webpack-dev-server!')
21 console.log('Are you using the --hmr flag for ng serve?')
22 }
23} else {
24 bootstrap()
25}