service worker settings

This commit is contained in:
vabene1111
2025-07-28 21:45:45 +02:00
parent 2a6a87ec16
commit 5dc3116c44
3 changed files with 7 additions and 1 deletions

View File

@@ -10,6 +10,12 @@ server {
alias /media/; alias /media/;
add_header Content-Disposition 'attachment; filename="$args"'; add_header Content-Disposition 'attachment; filename="$args"';
} }
# serve service worker under main path
location = /service-worker.js {
alias /opt/recipes/staticfiles/vue3/service-worker.js;
}
# pass requests for dynamic content to gunicorn # pass requests for dynamic content to gunicorn
location / { location / {
proxy_set_header Host $http_host; proxy_set_header Host $http_host;

View File

@@ -19,7 +19,7 @@ export default defineConfig({
registerType: 'autoUpdate', registerType: 'autoUpdate',
strategies: 'injectManifest', strategies: 'injectManifest',
srcDir: 'src', srcDir: 'src',
filename: 'sw.ts', filename: 'service-worker.ts',
injectManifest: { injectManifest: {
swDest: "../cookbook/templates/sw.js", swDest: "../cookbook/templates/sw.js",
injectionPoint: undefined injectionPoint: undefined