From edcde1432fa4095086ffd625e9b9e63f356e948b Mon Sep 17 00:00:00 2001 From: 0raclus Date: Mon, 11 May 2026 17:11:21 +0300 Subject: [PATCH] chore: add vercel.json for production deploy - framework: vite, output: dist - SPA fallback rewrite for non-asset routes (hash routing tolerates this but typed deep URLs still need it) - Service worker: must-revalidate + Service-Worker-Allowed:/ header so updates ship fast - manifest.webmanifest content-type - 1y immutable cache on /assets/* and /fonts/* --- vercel.json | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 vercel.json diff --git a/vercel.json b/vercel.json new file mode 100644 index 0000000..6142811 --- /dev/null +++ b/vercel.json @@ -0,0 +1,38 @@ +{ + "$schema": "https://openapi.vercel.sh/vercel.json", + "framework": "vite", + "buildCommand": "npm run build", + "outputDirectory": "dist", + "installCommand": "npm install", + "rewrites": [ + { "source": "/((?!api/|assets/|fonts/|.*\\.(?:js|css|map|png|jpg|jpeg|svg|gif|webp|ico|woff|woff2|ttf|wasm|webmanifest)).*)", "destination": "/index.html" } + ], + "headers": [ + { + "source": "/sw.js", + "headers": [ + { "key": "Cache-Control", "value": "public, max-age=0, must-revalidate" }, + { "key": "Service-Worker-Allowed", "value": "/" } + ] + }, + { + "source": "/manifest.webmanifest", + "headers": [ + { "key": "Content-Type", "value": "application/manifest+json" }, + { "key": "Cache-Control", "value": "public, max-age=3600" } + ] + }, + { + "source": "/assets/(.*)", + "headers": [ + { "key": "Cache-Control", "value": "public, max-age=31536000, immutable" } + ] + }, + { + "source": "/fonts/(.*)", + "headers": [ + { "key": "Cache-Control", "value": "public, max-age=31536000, immutable" } + ] + } + ] +}