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