Add plugin for offline PWA support (#2369)

* Add plugin for offline PWA support

* Add release notes

* Attempt to fix kcab fetch issue

* Fix type errors

* Cache more file types

* Empty commit to try to bump action

* Attempt to fix fonts
This commit is contained in:
Julian Dominguez-Schatz
2024-02-20 20:23:27 -05:00
committed by GitHub
parent e526555748
commit bfb7c1d213
5 changed files with 1714 additions and 5 deletions

View File

@@ -58,6 +58,9 @@
"typescript": "^5.0.2",
"typescript-strict-plugin": "^2.2.2-beta.2"
},
"resolutions": {
"rollup": "4.9.4"
},
"engines": {
"node": ">=18.0.0"
},

View File

@@ -67,6 +67,7 @@
"terser-webpack-plugin": "^5.3.10",
"uuid": "^9.0.1",
"vite": "^5.0.12",
"vite-plugin-pwa": "^0.19.0",
"vite-tsconfig-paths": "^4.3.1",
"vitest": "^1.2.1",
"webpack-bundle-analyzer": "^4.10.1",

View File

@@ -7,6 +7,7 @@ import react from '@vitejs/plugin-react-swc';
import { visualizer } from 'rollup-plugin-visualizer';
/// <reference types="vitest" />
import { defineConfig, loadEnv, Plugin } from 'vite';
import { VitePWA } from 'vite-plugin-pwa';
import viteTsconfigPaths from 'vite-tsconfig-paths';
const addWatchers = (): Plugin => ({
@@ -147,6 +148,15 @@ export default defineConfig(async ({ mode }) => {
extensions: resolveExtensions,
},
plugins: [
VitePWA({
registerType: 'autoUpdate',
workbox: {
globPatterns: [
'**/*.{js,css,html,txt,wasm,sql,sqlite,ico,png,woff2,webmanifest}',
],
ignoreURLParametersMatching: [/^v$/],
},
}),
injectShims(),
addWatchers(),
react({

View File

@@ -0,0 +1,6 @@
---
category: Features
authors: [jfdoming]
---
Add offline support to PWA

1699
yarn.lock

File diff suppressed because it is too large Load Diff