feat(main): use vite's rewrite instead of vercel's

This commit is contained in:
Kim, Jimin 2024-04-27 23:39:23 +09:00
parent 9cc89a1a2a
commit 6d362eb5c4
Signed by: pomp
GPG key ID: 2B516173EDD492EB
2 changed files with 10 additions and 9 deletions

View file

@ -11,5 +11,15 @@ export default defineConfig({
},
server: {
open: true,
proxy: {
// https://umami.is/docs/guides/bypass-ad-blockers
// https://vitejs.dev/config/server-options.html#server-proxy
// https://developomp.com/stats/* -> https://analytics.umami.is/*
"^/stats/.*": {
target: "https://analytics.umami.is/",
changeOrigin: true,
rewrite: (path) => path.slice(6), // slice "/stats" off the string (which is 6 characters long)
},
},
},
})