aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/main.ts
diff options
context:
space:
mode:
Diffstat (limited to 'client/src/main.ts')
-rw-r--r--client/src/main.ts16
1 files changed, 14 insertions, 2 deletions
diff --git a/client/src/main.ts b/client/src/main.ts
index f3825fe50..b02b6830f 100644
--- a/client/src/main.ts
+++ b/client/src/main.ts
@@ -4,10 +4,22 @@ import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'
4import { AppModule } from './app/app.module' 4import { AppModule } from './app/app.module'
5import { environment } from './environments/environment' 5import { environment } from './environments/environment'
6 6
7import { hmrBootstrap } from './hmr'
8
7if (environment.production) { 9if (environment.production) {
8 enableProdMode() 10 enableProdMode()
9} 11}
10 12
11platformBrowserDynamic() 13const bootstrap = () => platformBrowserDynamic()
12 .bootstrapModule(AppModule) 14 .bootstrapModule(AppModule)
13 .catch(err => console.log(err)) 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}