Add service worker to application startup
This commit is contained in:
@@ -8,6 +8,11 @@
|
||||
"projects": {
|
||||
"proto-creator": {
|
||||
"projectType": "application",
|
||||
"schematics": {
|
||||
"@schematics/angular:component": {
|
||||
"style": "scss"
|
||||
}
|
||||
},
|
||||
"root": "",
|
||||
"sourceRoot": "src",
|
||||
"prefix": "app",
|
||||
@@ -20,6 +25,7 @@
|
||||
"browser": "src/main.ts",
|
||||
"polyfills": [],
|
||||
"tsConfig": "tsconfig.app.json",
|
||||
"inlineStyleLanguage": "scss",
|
||||
"assets": [
|
||||
{
|
||||
"glob": "**/*",
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import {
|
||||
APP_INITIALIZER,
|
||||
ApplicationConfig,
|
||||
isDevMode,
|
||||
provideExperimentalZonelessChangeDetection,
|
||||
} from '@angular/core';
|
||||
import { provideRouter } from '@angular/router';
|
||||
@@ -10,6 +11,7 @@ import {
|
||||
MatIconRegistry,
|
||||
} from '@angular/material/icon';
|
||||
import { provideAnimationsAsync } from '@angular/platform-browser/animations/async';
|
||||
import { provideServiceWorker } from '@angular/service-worker';
|
||||
import hljs from 'highlight.js/lib/core';
|
||||
import json from 'highlight.js/lib/languages/json';
|
||||
import { provideMonacoEditor } from 'ngx-monaco-editor-v2';
|
||||
@@ -43,5 +45,9 @@ export const appConfig: ApplicationConfig = {
|
||||
useValue: { fontSet: 'material-symbols-rounded' },
|
||||
},
|
||||
provideMonacoEditor(),
|
||||
provideServiceWorker('ngsw-worker.js', {
|
||||
enabled: !isDevMode(),
|
||||
registrationStrategy: 'registerWhenStable:30000',
|
||||
}),
|
||||
],
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user