This commit is contained in:
BENEDEK László 2025-06-09 15:28:57 +02:00
parent 066e5463b2
commit 0b40da51e6
15 changed files with 128 additions and 6 deletions

View File

@ -62,7 +62,8 @@
"maximumError": "8kB" "maximumError": "8kB"
} }
], ],
"outputHashing": "all" "outputHashing": "all",
"serviceWorker": "ngsw-config.json"
}, },
"development": { "development": {
"optimization": false, "optimization": false,
@ -137,5 +138,8 @@
"@schematics/angular:resolver": { "@schematics/angular:resolver": {
"typeSeparator": "." "typeSeparator": "."
} }
},
"cli": {
"analytics": false
} }
} }

30
ngsw-config.json Normal file
View File

@ -0,0 +1,30 @@
{
"$schema": "./node_modules/@angular/service-worker/config/schema.json",
"index": "/index.html",
"assetGroups": [
{
"name": "app",
"installMode": "prefetch",
"resources": {
"files": [
"/favicon.ico",
"/index.csr.html",
"/index.html",
"/manifest.webmanifest",
"/*.css",
"/*.js"
]
}
},
{
"name": "assets",
"installMode": "lazy",
"updateMode": "prefetch",
"resources": {
"files": [
"/**/*.(svg|cur|jpg|jpeg|png|apng|webp|avif|gif|otf|ttf|woff|woff2)"
]
}
}
]
}

20
package-lock.json generated
View File

@ -18,6 +18,7 @@
"@angular/platform-browser": "^20.0.2", "@angular/platform-browser": "^20.0.2",
"@angular/platform-browser-dynamic": "^20.0.2", "@angular/platform-browser-dynamic": "^20.0.2",
"@angular/router": "^20.0.2", "@angular/router": "^20.0.2",
"@angular/service-worker": "^20.0.2",
"ngx-markdown": "^20.0.0", "ngx-markdown": "^20.0.0",
"ngx-toastr": "^19.0.0", "ngx-toastr": "^19.0.0",
"prismjs": "^1.30.0", "prismjs": "^1.30.0",
@ -605,6 +606,25 @@
"rxjs": "^6.5.3 || ^7.4.0" "rxjs": "^6.5.3 || ^7.4.0"
} }
}, },
"node_modules/@angular/service-worker": {
"version": "20.0.2",
"resolved": "https://registry.npmjs.org/@angular/service-worker/-/service-worker-20.0.2.tgz",
"integrity": "sha512-3Kg4wFX0WjeTH7rEQurbNgcf1e4wTIie6au5/Q3ktqfYpKVa9p6d4Zqd8vJw5VqmTXnV09ZMB3czQQz2RvfBxA==",
"license": "MIT",
"dependencies": {
"tslib": "^2.3.0"
},
"bin": {
"ngsw-config": "ngsw-config.js"
},
"engines": {
"node": "^20.19.0 || ^22.12.0 || >=24.0.0"
},
"peerDependencies": {
"@angular/core": "20.0.2",
"rxjs": "^6.5.3 || ^7.4.0"
}
},
"node_modules/@antfu/install-pkg": { "node_modules/@antfu/install-pkg": {
"version": "1.1.0", "version": "1.1.0",
"resolved": "https://registry.npmjs.org/@antfu/install-pkg/-/install-pkg-1.1.0.tgz", "resolved": "https://registry.npmjs.org/@antfu/install-pkg/-/install-pkg-1.1.0.tgz",

View File

@ -20,6 +20,7 @@
"@angular/platform-browser": "^20.0.2", "@angular/platform-browser": "^20.0.2",
"@angular/platform-browser-dynamic": "^20.0.2", "@angular/platform-browser-dynamic": "^20.0.2",
"@angular/router": "^20.0.2", "@angular/router": "^20.0.2",
"@angular/service-worker": "^20.0.2",
"ngx-markdown": "^20.0.0", "ngx-markdown": "^20.0.0",
"ngx-toastr": "^19.0.0", "ngx-toastr": "^19.0.0",
"prismjs": "^1.30.0", "prismjs": "^1.30.0",
@ -40,4 +41,4 @@
"karma-jasmine-html-reporter": "~2.1.0", "karma-jasmine-html-reporter": "~2.1.0",
"typescript": "~5.8.3" "typescript": "~5.8.3"
} }
} }

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

BIN
public/icons/icon-72x72.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

BIN
public/icons/icon-96x96.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

View File

@ -0,0 +1,57 @@
{
"name": "Chat",
"short_name": "Chat",
"display": "standalone",
"scope": "./",
"start_url": "./",
"icons": [
{
"src": "icons/icon-72x72.png",
"sizes": "72x72",
"type": "image/png",
"purpose": "maskable any"
},
{
"src": "icons/icon-96x96.png",
"sizes": "96x96",
"type": "image/png",
"purpose": "maskable any"
},
{
"src": "icons/icon-128x128.png",
"sizes": "128x128",
"type": "image/png",
"purpose": "maskable any"
},
{
"src": "icons/icon-144x144.png",
"sizes": "144x144",
"type": "image/png",
"purpose": "maskable any"
},
{
"src": "icons/icon-152x152.png",
"sizes": "152x152",
"type": "image/png",
"purpose": "maskable any"
},
{
"src": "icons/icon-192x192.png",
"sizes": "192x192",
"type": "image/png",
"purpose": "maskable any"
},
{
"src": "icons/icon-384x384.png",
"sizes": "384x384",
"type": "image/png",
"purpose": "maskable any"
},
{
"src": "icons/icon-512x512.png",
"sizes": "512x512",
"type": "image/png",
"purpose": "maskable any"
}
]
}

View File

@ -1,4 +1,4 @@
import { ApplicationConfig, provideZoneChangeDetection } from '@angular/core'; import { ApplicationConfig, provideZoneChangeDetection, isDevMode } from '@angular/core';
import { provideRouter, withInMemoryScrolling } from '@angular/router'; import { provideRouter, withInMemoryScrolling } from '@angular/router';
import { routes } from './app.routes'; import { routes } from './app.routes';
@ -6,6 +6,7 @@ import { provideHttpClient } from '@angular/common/http';
import { provideToastr } from 'ngx-toastr'; import { provideToastr } from 'ngx-toastr';
import { provideAnimations } from '@angular/platform-browser/animations'; import { provideAnimations } from '@angular/platform-browser/animations';
import { provideMarkdown } from 'ngx-markdown'; import { provideMarkdown } from 'ngx-markdown';
import { provideServiceWorker } from '@angular/service-worker';
export const appConfig: ApplicationConfig = { export const appConfig: ApplicationConfig = {
providers: [ providers: [
@ -21,6 +22,10 @@ export const appConfig: ApplicationConfig = {
positionClass: 'toast-top-right', positionClass: 'toast-top-right',
closeButton: true closeButton: true
}), }),
provideMarkdown() provideMarkdown(),
provideServiceWorker('ngsw-worker.js', {
enabled: !isDevMode(),
registrationStrategy: 'registerWhenStable:30000'
})
] ]
}; };

View File

@ -1,15 +1,20 @@
<!doctype html> <!doctype html>
<html lang="en"> <html lang="en">
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<title>Chat</title> <title>Chat</title>
<base href="/"> <base href="/">
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/x-icon" href="favicon.ico"> <link rel="icon" type="image/x-icon" href="favicon.ico">
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500&display=swap" rel="stylesheet"> <link href="https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500&amp;display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet"> <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<link rel="manifest" href="manifest.webmanifest">
</head> </head>
<body class="mat-typography"> <body class="mat-typography">
<app-root></app-root> <app-root></app-root>
<noscript>Please enable JavaScript to continue using this application.</noscript>
</body> </body>
</html>
</html>