Skip to content

Commit 3b61322

Browse files
authored
🚀 feat: Enhance PWA and asset caching strategy (danny-avila#3822)
* chore: Update VitePWA registerType to 'autoUpdate', add cache busting to static file outputs * chore: disable windows frontend workflow for now
1 parent 7c1ee24 commit 3b61322

File tree

2 files changed

+26
-22
lines changed

2 files changed

+26
-22
lines changed

.github/workflows/frontend-review.yml

Lines changed: 22 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -33,24 +33,25 @@ jobs:
3333
run: npm run test:ci --verbose
3434
working-directory: client
3535

36-
tests_frontend_windows:
37-
name: Run frontend unit tests on Windows
38-
timeout-minutes: 60
39-
runs-on: windows-latest
40-
steps:
41-
- uses: actions/checkout@v4
42-
- name: Use Node.js 20.x
43-
uses: actions/setup-node@v4
44-
with:
45-
node-version: 20
46-
cache: 'npm'
47-
48-
- name: Install dependencies
49-
run: npm ci
50-
51-
- name: Build Client
52-
run: npm run frontend:ci
53-
54-
- name: Run unit tests
55-
run: npm run test:ci --verbose
56-
working-directory: client
36+
# Windows job is commented out
37+
# tests_frontend_windows:
38+
# name: Run frontend unit tests on Windows
39+
# timeout-minutes: 60
40+
# runs-on: windows-latest
41+
# steps:
42+
# - uses: actions/checkout@v4
43+
# - name: Use Node.js 20.x
44+
# uses: actions/setup-node@v4
45+
# with:
46+
# node-version: 20
47+
# cache: 'npm'
48+
49+
# - name: Install dependencies
50+
# run: npm ci
51+
52+
# - name: Build Client
53+
# run: npm run frontend:ci
54+
55+
# - name: Run unit tests
56+
# run: npm run test:ci --verbose
57+
# working-directory: client

client/vite.config.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ export default defineConfig({
5555
nodePolyfills(),
5656
VitePWA({
5757
injectRegister: 'auto', // 'auto' | 'manual' | 'disabled'
58-
registerType: 'prompt', // 'prompt' | 'auto' | 'disabled'
58+
registerType: 'autoUpdate', // 'prompt' | 'autoUpdate'
5959
devOptions: {
6060
enabled: false, // enable/disable registering SW in development mode
6161
},
@@ -118,6 +118,9 @@ export default defineConfig({
118118
return 'vendor';
119119
}
120120
},
121+
entryFileNames: 'assets/[name].[hash].js',
122+
chunkFileNames: 'assets/[name].[hash].js',
123+
assetFileNames: 'assets/[name].[hash].[ext]',
121124
},
122125
/**
123126
* Ignore "use client" waning since we are not using SSR

0 commit comments

Comments
 (0)