fix voor build locatie van notificatie service worker
Some checks failed
linter / quality (push) Failing after 1m7s
tests / ci (8.3) (push) Failing after 50s
tests / ci (8.4) (push) Failing after 1m9s
tests / ci (8.5) (push) Failing after 1m7s

This commit is contained in:
Daan Meijer 2026-06-21 23:36:07 +02:00
parent 98dc8659ba
commit bcf583866a
4 changed files with 3491 additions and 3 deletions

2
.gitignore vendored
View File

@ -27,3 +27,5 @@ yarn-error.log
/.nova /.nova
/.vscode /.vscode
/.zed /.zed
/public/sw.js
/public/workbox-*.js

3465
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -34,6 +34,7 @@
"typescript": "^5.2.2", "typescript": "^5.2.2",
"typescript-eslint": "^8.23.0", "typescript-eslint": "^8.23.0",
"vite": "^8.0.0", "vite": "^8.0.0",
"vite-plugin-pwa": "^1.3.0",
"vue-tsc": "^2.2.4" "vue-tsc": "^2.2.4"
}, },
"dependencies": { "dependencies": {

View File

@ -6,13 +6,15 @@ import laravel from 'laravel-vite-plugin';
import { bunny } from 'laravel-vite-plugin/fonts'; import { bunny } from 'laravel-vite-plugin/fonts';
import { defineConfig } from 'vite'; import { defineConfig } from 'vite';
import { VitePWA } from 'vite-plugin-pwa';
export default defineConfig({ export default defineConfig({
resolve: { resolve: {
dedupe: ['@laravel/echo-vue'], dedupe: ['@laravel/echo-vue'],
}, },
plugins: [ plugins: [
laravel({ laravel({
input: ['resources/css/app.css', 'resources/js/app.ts', 'resources/js/sw.js'], input: ['resources/css/app.css', 'resources/js/app.ts'],
refresh: true, refresh: true,
fonts: [ fonts: [
bunny('Instrument Sans', { bunny('Instrument Sans', {
@ -33,5 +35,27 @@ export default defineConfig({
wayfinder({ wayfinder({
formVariants: true, formVariants: true,
}), }),
VitePWA({
registerType: 'autoUpdate',
injectRegister: 'auto',
workbox: {
globPatterns: ['**/*.{js,css,html,ico,png,svg}'],
runtimeCaching: [
{
urlPattern: ({ url }) => url.pathname.startsWith('/'),
handler: 'NetworkFirst',
options: {
cacheName: 'api-cache',
cacheableResponse: {
statuses: [0, 200],
},
},
},
],
},
srcDir: 'resources/js',
filename: 'sw.js',
outDir: 'public',
}),
], ],
}); });