File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -15,6 +15,10 @@ export function usePostHog() {
1515 cookieless_mode : "always" ,
1616 defaults : "2026-01-30" ,
1717 } ) ;
18+ posthog . register ( {
19+ build_date : __BUILD_DATE__ ,
20+ build_sha : __BUILD_SHA__ ,
21+ } ) ;
1822 }
1923 initialized = true ;
2024 }
Original file line number Diff line number Diff line change 11/// <reference types="vite/client" />
22/// <reference types="vite-plugin-pwa/client" />
3+
4+ declare const __BUILD_DATE__ : string ;
5+ declare const __BUILD_SHA__ : string ;
Original file line number Diff line number Diff line change @@ -3,11 +3,15 @@ import vue from "@vitejs/plugin-vue";
33import { viteStaticCopy } from "vite-plugin-static-copy" ;
44import { VitePWA } from "vite-plugin-pwa" ;
55import path from "path" ;
6+ import { execSync } from "child_process" ;
67
78const cesiumEngineSource = "node_modules/@cesium/engine" ;
89const cesiumWidgetsSource = "node_modules/@cesium/widgets" ;
910const cesiumBaseUrl = "cesium" ;
1011
12+ const buildDate = new Date ( ) . toISOString ( ) . replace ( / \. \d { 3 } Z $ / , "Z" ) ;
13+ const buildSha = execSync ( "git rev-parse --short HEAD" ) . toString ( ) . trim ( ) ;
14+
1115export default defineConfig ( {
1216 base : "" ,
1317 build : {
@@ -50,6 +54,8 @@ export default defineConfig({
5054 define : {
5155 // Define relative base path in cesium for loading assets
5256 CESIUM_BASE_URL : JSON . stringify ( "./cesium" ) ,
57+ __BUILD_DATE__ : JSON . stringify ( buildDate ) ,
58+ __BUILD_SHA__ : JSON . stringify ( buildSha ) ,
5359 } ,
5460 plugins : [
5561 vue ( ) ,
You can’t perform that action at this time.
0 commit comments