Feature/pwa (#2246)

* setup ui project with pwa configurations

* enable service worker config to work with ionic livereload

* fix service worker key placement

* update webmanifest names

* cleanup

* shrink logo size

* fix package build

* build fix

* fix icon size in webmanifest
This commit is contained in:
Lucy C
2023-04-11 10:36:25 -06:00
committed by GitHub
parent 70afb197f1
commit ba3805786c
10 changed files with 617 additions and 442 deletions

View File

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

View File

@@ -31,6 +31,8 @@ import { PatchDbModule } from './services/patch-db/patch-db.module'
import { ToastContainerModule } from './components/toast-container/toast-container.module'
import { ConnectionBarComponentModule } from './components/connection-bar/connection-bar.component.module'
import { WidgetsPageModule } from './pages/widgets/widgets.module'
import { ServiceWorkerModule } from '@angular/service-worker'
import { environment } from '../environments/environment'
@NgModule({
declarations: [AppComponent],
@@ -62,6 +64,12 @@ import { WidgetsPageModule } from './pages/widgets/widgets.module'
ResponsiveColModule,
DarkThemeModule,
LightThemeModule,
ServiceWorkerModule.register('ngsw-worker.js', {
enabled: environment.useServiceWorker,
// Register the ServiceWorker as soon as the application is stable
// or after 30 seconds (whichever comes first).
registrationStrategy: 'registerWhenStable:30000',
}),
],
providers: APP_PROVIDERS,
bootstrap: [AppComponent],

View File

@@ -1,3 +1,4 @@
export const environment = {
production: true,
useServiceWorker: true,
}

View File

@@ -4,6 +4,7 @@
export const environment = {
production: false,
useServiceWorker: true,
}
/*

View File

@@ -14,12 +14,14 @@
<meta name="msapplication-tap-highlight" content="no" />
<link rel="icon" type="image/x-icon" href="assets/icon/favicon.ico" />
<link rel="manifest" href="manifest.webmanifest" />
<meta name="theme-color" content="#ff5b71" />
</head>
<body>
<app-root></app-root>
<noscript
>Please enable JavaScript to continue using this application.</noscript
>
<noscript>
Please enable JavaScript to continue using this application.
</noscript>
</body>
</html>

View File

@@ -0,0 +1,18 @@
{
"name": "StartOS",
"short_name": "StartOS",
"theme_color": "#ff5b71",
"background_color": "#1e1e1e",
"display": "standalone",
"scope": ".",
"start_url": "/",
"id": "/",
"icons": [
{
"src": "assets/img/logo_solid.png",
"sizes": "256x256",
"type": "image/png",
"purpose": "any"
}
]
}