diff --git a/nginx/conf.d/Recipes.conf b/nginx/conf.d/Recipes.conf index e3b4456da..7157fb47e 100644 --- a/nginx/conf.d/Recipes.conf +++ b/nginx/conf.d/Recipes.conf @@ -10,6 +10,12 @@ server { alias /media/; 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 location / { proxy_set_header Host $http_host; diff --git a/vue3/src/sw.ts b/vue3/src/service-worker.ts similarity index 100% rename from vue3/src/sw.ts rename to vue3/src/service-worker.ts diff --git a/vue3/vite.config.ts b/vue3/vite.config.ts index 58463a0af..ca4ac93af 100644 --- a/vue3/vite.config.ts +++ b/vue3/vite.config.ts @@ -19,7 +19,7 @@ export default defineConfig({ registerType: 'autoUpdate', strategies: 'injectManifest', srcDir: 'src', - filename: 'sw.ts', + filename: 'service-worker.ts', injectManifest: { swDest: "../cookbook/templates/sw.js", injectionPoint: undefined