diff --git a/index.html b/index.html index 42965167e..b1615f44f 100644 --- a/index.html +++ b/index.html @@ -20,13 +20,7 @@ content="https://repository-images.githubusercontent.com/581644549/d5eec580-ba3d-41e8-87db-58c313bf3f45" /> - + %VITE_ANALYTICS_SCRIPT%
diff --git a/vite.config.ts b/vite.config.ts index fdd554a3e..8c0d09637 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -2,6 +2,17 @@ import { defineConfig } from "vite"; import react from "@vitejs/plugin-react"; import { VitePWA } from "vite-plugin-pwa"; +const isProd = process.env.NODE_ENV === "production"; +process.env.VITE_ANALYTICS_SCRIPT = isProd + ? ` +` + : ""; + // https://vitejs.dev/config/ export default defineConfig({ base: process.env.VITE_BASE ?? "/",