projects
/
oweals
/
peertube.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add ability to import videos from all supported youtube-dl sites
[oweals/peertube.git]
/
client
/
src
/
main.ts
diff --git
a/client/src/main.ts
b/client/src/main.ts
index f3825fe50cbbbe79226afda1603c1053ec5b71fb..b02b6830f4c1f0f9c722f045b81d02356d076594 100644
(file)
--- a/
client/src/main.ts
+++ b/
client/src/main.ts
@@
-4,10
+4,22
@@
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'
import { AppModule } from './app/app.module'
import { environment } from './environments/environment'
import { AppModule } from './app/app.module'
import { environment } from './environments/environment'
+import { hmrBootstrap } from './hmr'
+
if (environment.production) {
enableProdMode()
}
if (environment.production) {
enableProdMode()
}
-platformBrowserDynamic()
+
const bootstrap = () =>
platformBrowserDynamic()
.bootstrapModule(AppModule)
.bootstrapModule(AppModule)
- .catch(err => console.log(err))
+
+if (environment.hmr) {
+ if (module[ 'hot' ]) {
+ hmrBootstrap(module, bootstrap)
+ } else {
+ console.error('HMR is not enabled for webpack-dev-server!')
+ console.log('Are you using the --hmr flag for ng serve?')
+ }
+} else {
+ bootstrap()
+}