diff options
Diffstat (limited to 'client/src/main.ts')
-rw-r--r-- | client/src/main.ts | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/client/src/main.ts b/client/src/main.ts index b02b6830f..9686ba4b8 100644 --- a/client/src/main.ts +++ b/client/src/main.ts | |||
@@ -12,6 +12,19 @@ if (environment.production) { | |||
12 | 12 | ||
13 | const bootstrap = () => platformBrowserDynamic() | 13 | const bootstrap = () => platformBrowserDynamic() |
14 | .bootstrapModule(AppModule) | 14 | .bootstrapModule(AppModule) |
15 | .then(bootstrapModule => { | ||
16 | // TODO: Remove when https://github.com/angular/angular-cli/issues/8779 is fixed? | ||
17 | if ('serviceWorker' in navigator && environment.production) { | ||
18 | navigator.serviceWorker.register('/ngsw-worker.js') | ||
19 | .catch(err => console.error('Cannot register service worker.', err)) | ||
20 | } | ||
21 | |||
22 | return bootstrapModule | ||
23 | }) | ||
24 | .catch(err => { | ||
25 | console.error(err) | ||
26 | return null | ||
27 | }) | ||
15 | 28 | ||
16 | if (environment.hmr) { | 29 | if (environment.hmr) { |
17 | if (module[ 'hot' ]) { | 30 | if (module[ 'hot' ]) { |