fix voor build locatie van notificatie service worker
This commit is contained in:
parent
98dc8659ba
commit
bcf583866a
2
.gitignore
vendored
2
.gitignore
vendored
@ -27,3 +27,5 @@ yarn-error.log
|
|||||||
/.nova
|
/.nova
|
||||||
/.vscode
|
/.vscode
|
||||||
/.zed
|
/.zed
|
||||||
|
/public/sw.js
|
||||||
|
/public/workbox-*.js
|
||||||
3465
package-lock.json
generated
3465
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -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": {
|
||||||
|
|||||||
@ -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',
|
||||||
|
}),
|
||||||
],
|
],
|
||||||
});
|
});
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user