Skip to content

Commit a10297d

Browse files
committed
added pwa support
1 parent a5d8159 commit a10297d

15 files changed

Lines changed: 111 additions & 3 deletions

angular.json

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@
2525
"aot": true,
2626
"assets": [
2727
"src/favicon.ico",
28-
"src/assets"
28+
"src/assets",
29+
"src/manifest.webmanifest"
2930
],
3031
"styles": [
3132
"src/styles.scss"
@@ -59,7 +60,9 @@
5960
"maximumWarning": "6kb",
6061
"maximumError": "10kb"
6162
}
62-
]
63+
],
64+
"serviceWorker": true,
65+
"ngswConfigPath": "ngsw-config.json"
6366
}
6467
}
6568
},
@@ -89,7 +92,8 @@
8992
"karmaConfig": "karma.conf.js",
9093
"assets": [
9194
"src/favicon.ico",
92-
"src/assets"
95+
"src/assets",
96+
"src/manifest.webmanifest"
9397
],
9498
"styles": [
9599
"src/styles.scss"

ngsw-config.json

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
{
2+
"$schema": "./node_modules/@angular/service-worker/config/schema.json",
3+
"index": "/index.html",
4+
"assetGroups": [
5+
{
6+
"name": "app",
7+
"installMode": "prefetch",
8+
"resources": {
9+
"files": [
10+
"/favicon.ico",
11+
"/index.html",
12+
"/manifest.webmanifest",
13+
"/*.css",
14+
"/*.js",
15+
"src/app/component/home-page/home-page.component.html"
16+
]
17+
}
18+
},
19+
{
20+
"name": "assets",
21+
"installMode": "lazy",
22+
"updateMode": "prefetch",
23+
"resources": {
24+
"files": [
25+
"/assets/**",
26+
"/*.(eot|svg|cur|jpg|png|webp|gif|otf|ttf|woff|woff2|ani)"
27+
]
28+
}
29+
}
30+
]
31+
}

package-lock.json

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
"@angular/platform-browser": "~10.0.6",
2121
"@angular/platform-browser-dynamic": "~10.0.6",
2222
"@angular/router": "~10.0.6",
23+
"@angular/service-worker": "~10.0.6",
2324
"firebase": "^7.17.2",
2425
"rxjs": "~6.5.5",
2526
"tslib": "^2.0.0",

src/app/app.module.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import { AppComponent } from './app.component';
88
import { LogInComponent } from './component/log-in/log-in.component';
99
import { HomePageComponent } from './component/home-page/home-page.component';
1010
import { environment } from '../environments/environment';
11+
import { ServiceWorkerModule, SwUpdate } from '@angular/service-worker';
1112

1213
@NgModule({
1314
declarations: [
@@ -20,6 +21,7 @@ import { environment } from '../environments/environment';
2021
AppRoutingModule,
2122
AngularFireAuthModule,
2223
AngularFireModule.initializeApp(environment.firebase),
24+
ServiceWorkerModule.register('ngsw-worker.js', { enabled: environment.production }),
2325
],
2426
providers: [],
2527
bootstrap: [AppComponent]

src/assets/icons/icon-128x128.png

1.22 KB
Loading

src/assets/icons/icon-144x144.png

1.36 KB
Loading

src/assets/icons/icon-152x152.png

1.39 KB
Loading

src/assets/icons/icon-192x192.png

1.75 KB
Loading

src/assets/icons/icon-384x384.png

3.47 KB
Loading

0 commit comments

Comments
 (0)