From 918f8d2abc235f7b4834fff5db74117a7adf8ef4 Mon Sep 17 00:00:00 2001 From: barshathakuri Date: Wed, 31 Jul 2024 16:47:28 +0545 Subject: [PATCH] Integrate google analytics --- env.ts | 1 + package.json | 2 +- src/views/Resources/styles.module.css | 1 - vite.config.ts | 7 +++++++ yarn.lock | 8 ++++---- 5 files changed, 13 insertions(+), 6 deletions(-) diff --git a/env.ts b/env.ts index f05b2b7..7357630 100644 --- a/env.ts +++ b/env.ts @@ -5,4 +5,5 @@ export default defineConfig({ APP_TITLE: Schema.string.optional(), APP_MAPBOX_ACCESS_TOKEN: Schema.string(), APP_GRAPHQL_ENDPOINT: Schema.string.optional(), + APP_GOOGLE_ANALYTICS_ID: Schema.string.optional(), }) diff --git a/package.json b/package.json index d0c3cd7..0e56e1a 100644 --- a/package.json +++ b/package.json @@ -86,7 +86,7 @@ "vite": "^5.2.6", "vite-plugin-checker": "^0.6.2", "vite-plugin-compression2": "^1.0.0", - "vite-plugin-radar": "^0.9.2", + "vite-plugin-radar": "^0.9.6", "vite-plugin-svgr": "^4.2.0", "vite-plugin-webfont-dl": "3.9.2", "vite-tsconfig-paths": "^4.2.2", diff --git a/src/views/Resources/styles.module.css b/src/views/Resources/styles.module.css index 78de480..001a525 100644 --- a/src/views/Resources/styles.module.css +++ b/src/views/Resources/styles.module.css @@ -19,4 +19,3 @@ } } } - diff --git a/vite.config.ts b/vite.config.ts index c33ae91..97d5b48 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -6,6 +6,8 @@ import { execSync } from 'child_process'; import { compression } from 'vite-plugin-compression2'; import checker from 'vite-plugin-checker'; import { ValidateEnv as validateEnv } from '@julr/vite-plugin-validate-env'; +import { VitePluginRadar } from 'vite-plugin-radar'; + import alertHubPackage from './package.json'; /* Get commit hash */ @@ -35,6 +37,11 @@ export default defineConfig(({ mode }) => { webfontDownload(), validateEnv(), isProd ? compression() : undefined, + VitePluginRadar({ + analytics: { + id: env.APP_GOOGLE_ANALYTICS_ID, + }, + }) ], css: { devSourcemap: isProd, diff --git a/yarn.lock b/yarn.lock index 7e64011..5ca4e2a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -10451,10 +10451,10 @@ vite-plugin-compression2@^1.0.0: gunzip-maybe "^1.4.2" tar-stream "^3.1.7" -vite-plugin-radar@^0.9.2: - version "0.9.4" - resolved "https://registry.yarnpkg.com/vite-plugin-radar/-/vite-plugin-radar-0.9.4.tgz#917dc0425680327edd9be87830f0489e8008b398" - integrity sha512-JhUP3yODDLGsAmz+PVRaxLyJYzC3PWTnAezbhuaRONvo7gFHDTU7AcY6+6tOgyDstOJjG2Qb3oUdiEorPVxl4A== +vite-plugin-radar@^0.9.6: + version "0.9.6" + resolved "https://registry.yarnpkg.com/vite-plugin-radar/-/vite-plugin-radar-0.9.6.tgz#59ae700d478e495cad0c46f7b968550690dbd234" + integrity sha512-tLvUt7+iZznxYa8GmCrZBV3Q0fLQApsyg9EIJgaen8DjGky3vFIq9KoDWAoVMs9FZ5qbsSBb3YfSvoqwVV+5xw== vite-plugin-svgr@^4.2.0: version "4.2.0"