File tree Expand file tree Collapse file tree 3 files changed +28
-6
lines changed Expand file tree Collapse file tree 3 files changed +28
-6
lines changed Original file line number Diff line number Diff line change 1414.PHONY : build
1515build :
1616 VITE_RELEASE_CHANNEL=prod \
17- VITE_DEMO_SIGN_IN_ENABLED=true \
18- VITE_DEMO_SIGN_IN_EMAIL=demo@bucketeer.io \
19- VITE_DEMO_SIGN_IN_PASSWORD=demo \
2017 yarn build
Original file line number Diff line number Diff line change 88 </ head >
99
1010 < body >
11+ < script src ="/static/js/env.js "> </ script >
1112 < div id ="root "> </ div >
1213 < script type ="module " src ="/src/main.tsx "> </ script >
1314 </ body >
Original file line number Diff line number Diff line change @@ -5,6 +5,17 @@ export const tailwindConfig = resolveConfig(customTailwindConfig);
55
66const releaseMode = import . meta. env . VITE_RELEASE_CHANNEL ;
77
8+ declare global {
9+ interface Window {
10+ env : {
11+ DEMO_SIGN_IN_ENABLED ?: boolean ;
12+ DEMO_SIGN_IN_EMAIL ?: string ;
13+ VITE_DEMO_SIGN_IN_PASSWORD ?: string ;
14+ GOOGLE_TAG_MANAGER_ID ?: string ;
15+ } ;
16+ }
17+ }
18+
819export const urls = {
920 GRPC : releaseMode !== 'prod' ? import . meta. env . VITE_WEB_API_ENDPOINT : '' ,
1021 AUTH_REDIRECT :
@@ -13,6 +24,19 @@ export const urls = {
1324 : `${ window . location . origin } /auth/callback`
1425} ;
1526
16- export const DEMO_SIGN_IN_ENABLED = import . meta. env . VITE_DEMO_SIGN_IN_ENABLED ;
17- export const DEMO_SIGN_IN_EMAIL = import . meta. env . VITE_DEMO_SIGN_IN_EMAIL ;
18- export const DEMO_SIGN_IN_PASSWORD = import . meta. env . VITE_DEMO_SIGN_IN_PASSWORD ;
27+ export const GOOGLE_TAG_MANAGER_ID = window . env ?. GOOGLE_TAG_MANAGER_ID || '' ;
28+
29+ export const DEMO_SIGN_IN_ENABLED =
30+ releaseMode !== 'prod'
31+ ? import . meta. env . VITE_DEMO_SIGN_IN_ENABLED
32+ : window . env ?. DEMO_SIGN_IN_ENABLED ;
33+
34+ export const DEMO_SIGN_IN_EMAIL =
35+ releaseMode !== 'prod'
36+ ? import . meta. env . VITE_DEMO_SIGN_IN_EMAIL
37+ : window . env ?. DEMO_SIGN_IN_EMAIL ;
38+
39+ export const DEMO_SIGN_IN_PASSWORD =
40+ releaseMode !== 'prod'
41+ ? import . meta. env . VITE_DEMO_SIGN_IN_ENABLED
42+ : window . env ?. VITE_DEMO_SIGN_IN_PASSWORD ;
You can’t perform that action at this time.
0 commit comments