Skip to content

Database diagrams editor that allows you to visualize and design your DB with a single query.

fix: make VITE_DISABLE_ANALYTICS actually disable analytics (#910) (#1171)

Jonathan Fishner880b4c46cedc
diff --git a/index.html b/index.html
index 000318e2..0b6bd96b 100644
--- a/index.html
+++ b/index.html
@@ -17,11 +17,11 @@
<script>
// Load analytics only if not disabled
(function () {
+ // %VITE_DISABLE_ANALYTICS% is replaced by Vite at dev/build time
+ // (process.env does not exist in the browser, see #910)
const disableAnalytics =
(window.env && window.env.DISABLE_ANALYTICS === 'true') ||
- (typeof process !== 'undefined' &&
- process.env &&
- process.env.VITE_DISABLE_ANALYTICS === 'true');
+ '%VITE_DISABLE_ANALYTICS%' === 'true';
if (!disableAnalytics) {
const script = document.createElement('script');