Skip to content

Commit af17f11

Browse files
update vite envs
1 parent 8d89e48 commit af17f11

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

.env

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
VITE_API_GATEWAY=api/gateway
22
VITE_WS_GATEWAY=ws/gateway
3+
VITE_DEBUG_REQUESTS=false

src/vite-env.d.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,22 @@
77

88
/// <reference types="vite-plugin-svgr/client" />
99
/// <reference types="vite/client" />
10+
11+
/* Don't know why but seem that TypeScript merge definitions of these two interfaces with existing ones.
12+
* https://vitejs.dev/guide/env-and-mode#intellisense-for-typescript
13+
*/
14+
import { UrlString } from '@gridsuite/commons-ui';
15+
16+
interface ImportMetaEnv {
17+
/* From @gridsuite/commons-ui */
18+
readonly VITE_API_GATEWAY: UrlString;
19+
readonly VITE_WS_GATEWAY: UrlString;
20+
// readonly VITE_DEBUG_REQUESTS?: boolean;
21+
readonly VITE_DEBUG_HOOK_RENDER?: boolean;
22+
/* From this app */
23+
readonly VITE_DEBUG_REQUESTS: boolean;
24+
}
25+
26+
interface ImportMeta {
27+
readonly env: ImportMetaEnv;
28+
}

0 commit comments

Comments
 (0)