File tree Expand file tree Collapse file tree 3 files changed +21
-1
lines changed
Expand file tree Collapse file tree 3 files changed +21
-1
lines changed Original file line number Diff line number Diff line change 5757
5858 - name : Build project
5959 run : pnpm run build
60+ env :
61+ VITE_DISABLE_VERCEL_ANALYTICS : " true"
6062
6163 - name : Install Caddy
6264 run : |
Original file line number Diff line number Diff line change @@ -14,10 +14,13 @@ const sanitizedBrowserLanguageIfSupportedOrEnglish =
1414 getSanitizedBrowserLanguageIfSupportedOrEnglish ( ) ;
1515await dynamicActivate ( sanitizedBrowserLanguageIfSupportedOrEnglish ) ;
1616
17+ const isAnalyticsEnabled =
18+ import . meta. env . VITE_DISABLE_VERCEL_ANALYTICS !== "true" ;
19+
1720// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
1821createRoot ( document . getElementById ( "root" ) ! ) . render (
1922 < StrictMode >
20- < Analytics />
23+ { isAnalyticsEnabled && < Analytics /> }
2124 < I18nProvider i18n = { i18n } >
2225 < App />
2326 </ I18nProvider >
Original file line number Diff line number Diff line change 22/// <reference types="vite-plugin-pwa/react" />
33/// <reference types="vite-plugin-pwa/pwa-assets" />
44
5+ // Define env variables used in the project
6+ // https://vite.dev/guide/env-and-mode.html#intellisense-for-typescript
7+
8+ interface ViteTypeOptions {
9+ strictImportMetaEnv : unknown ;
10+ }
11+
12+ interface ImportMetaEnv {
13+ readonly VITE_DISABLE_VERCEL_ANALYTICS : string ;
14+ }
15+
16+ interface ImportMeta {
17+ readonly env : ImportMetaEnv ;
18+ }
19+
520// TODO: Remove when no longer needed
621// https://developer.mozilla.org/en-US/docs/Web/API/LaunchParams
722// These types are not yet included in TypeScript's standard lib as of v4.9
You can’t perform that action at this time.
0 commit comments