Skip to content

Commit a7f7574

Browse files
committed
fix: add env vars to turbo config
This PR adds environment variables to the turbo configuration, which fixes an issue where they aren't available at build time due to [turbo environment strict mode](https://turbo.build/repo/docs/crafting-your-repository/using-environment-variables#strict-mode). As a result, statically generated pages do not have correct environment variables and in particular things like the RPC aren't set correctly
1 parent bcf162f commit a7f7574

File tree

3 files changed

+22
-3
lines changed

3 files changed

+22
-3
lines changed

apps/api-reference/turbo.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,12 @@
44
"tasks": {
55
"build": {
66
"dependsOn": ["pull:env", "^build"],
7-
"outputs": [".next/**", "!.next/cache/**"]
7+
"outputs": [".next/**", "!.next/cache/**"],
8+
"env": [
9+
"WALLETCONNECT_PROJECT_ID",
10+
"AMPLITUDE_API_KEY",
11+
"GOOGLE_ANALYTICS_ID"
12+
]
813
},
914
"pull:env": {
1015
"outputs": [".env.local"],

apps/staking/turbo.json

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,17 @@
44
"tasks": {
55
"build": {
66
"dependsOn": ["pull:env", "^build"],
7-
"outputs": [".next/**", "!.next/cache/**"]
7+
"outputs": [".next/**", "!.next/cache/**"],
8+
"env": [
9+
"IP_ALLOWLIST",
10+
"GOVERNANCE_ONLY_REGIONS",
11+
"WALLETCONNECT_PROJECT_ID",
12+
"PROXYCHECK_API_KEY",
13+
"MAINNET_RPC",
14+
"BLOCKED_REGIONS",
15+
"AMPLITUDE_API_KEY",
16+
"GOOGLE_ANALYTICS_ID"
17+
]
818
},
919
"pull:env": {
1020
"outputs": [".env.local"],

governance/xc_admin/packages/xc_admin_frontend/turbo.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,11 @@
55
"build": {
66
"dependsOn": ["pull:env", "^build"],
77
"outputs": [".next/**", "!.next/cache/**"],
8-
"env": ["BUILD_STANDALONE"]
8+
"env": [
9+
"BUILD_STANDALONE",
10+
"NEXT_PUBLIC_MAINNET_RPC",
11+
"NEXT_PUBLIC_WALLETCONNECT_PROJECT_ID"
12+
]
913
},
1014
"pull:env": {
1115
"outputs": [".env.local"],

0 commit comments

Comments
 (0)