Skip to content

Commit 386f6c8

Browse files
authored
feat: add offline pwa files (#722)
* feat: add offline pwa files * feat: add fonts to cached files list
1 parent 21cdfca commit 386f6c8

File tree

8 files changed

+2997
-242
lines changed

8 files changed

+2997
-242
lines changed

assets/bf_installer_icon.ico

-9.44 KB
Binary file not shown.

assets/bf_installer_small.bmp

-48.1 KB
Binary file not shown.

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@
2626
"leaflet-marker-rotation": "^0.4.0",
2727
"lodash": "^4.17.21",
2828
"throttle-debounce": "^5.0.0",
29-
"vite": "^5.0.12"
29+
"vite": "^5.2.6",
30+
"vite-plugin-pwa": "^0.19.7"
3031
},
3132
"devDependencies": {
3233
"inflection": "1.12.0",
File renamed without changes.

public/images/pwa/bf_icon_192.png

41.2 KB
Loading

public/images/pwa/bf_icon_256.png

52.1 KB
Loading

vite.config.js

Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,43 @@
1+
import { VitePWA } from 'vite-plugin-pwa';
2+
import pkg from './package.json';
3+
14
/** @type {import('vite').UserConfig} */
25
export default {
36
build: {
47
sourcemap: true,
5-
}
8+
},
9+
plugins: [
10+
VitePWA({
11+
registerType: 'autoUpdate',
12+
workbox: {
13+
globPatterns: ['**/*.{js,css,html,ico,png,svg,json,mcm,woff2}'],
14+
// 5MB
15+
maximumFileSizeToCacheInBytes: 5 * 1024 * 1024,
16+
},
17+
includeAssets: ['favicon.ico', 'robots.txt', 'apple-touch-icon.png'],
18+
manifest: {
19+
name: pkg.name,
20+
short_name: 'BBE',
21+
description: pkg.description,
22+
theme_color: '#ffffff',
23+
icons: [
24+
{
25+
src: '/images/pwa/bf_icon_128.png',
26+
sizes: '128x128',
27+
type: 'image/png',
28+
},
29+
{
30+
src: '/images/pwa/bf_icon_192.png',
31+
sizes: '192x192',
32+
type: 'image/png',
33+
},
34+
{
35+
src: '/images/pwa/bf_icon_256.png',
36+
sizes: '256x256',
37+
type: 'image/png',
38+
},
39+
],
40+
}
41+
})
42+
],
643
}

yarn.lock

Lines changed: 2957 additions & 240 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)