Skip to content

Commit

Permalink
Add plugin for offline PWA support (actualbudget#2369)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
jfdoming authored Feb 21, 2024
1 parent e526555 commit bfb7c1d
Show file tree
Hide file tree
Showing 5 changed files with 1,720 additions and 11 deletions.
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
},
Expand Down
1 change: 1 addition & 0 deletions packages/desktop-client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
10 changes: 10 additions & 0 deletions packages/desktop-client/vite.config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -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 => ({
Expand Down Expand Up @@ -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({
Expand Down
6 changes: 6 additions & 0 deletions upcoming-release-notes/2369.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
category: Features
authors: [jfdoming]
---

Add offline support to PWA
Loading

0 comments on commit bfb7c1d

Please sign in to comment.