aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/main.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2017-12-12 14:45:42 +0100
committerChocobozzz <me@florianbigard.com>2017-12-12 14:45:42 +0100
commit77d07d690968a9631fc0c8bafbaebd27a5ebaab6 (patch)
treed513fdc81ed82b60edaa0b683f5f8d8dc9fc9db3 /client/src/main.ts
parentb2731bff2834fb6aacf166cf435030bf96eb12f3 (diff)
downloadPeerTube-77d07d690968a9631fc0c8bafbaebd27a5ebaab6.tar.gz
PeerTube-77d07d690968a9631fc0c8bafbaebd27a5ebaab6.tar.zst
PeerTube-77d07d690968a9631fc0c8bafbaebd27a5ebaab6.zip
Add hmr
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}