fix potential build problems (Claude recommendations)
This commit is contained in:
+14
-12
@@ -1721,20 +1721,10 @@ VITE_APP_SERVER=https://timesafari.app
|
||||
fi
|
||||
```
|
||||
|
||||
2. **Platform-Specific Overrides**
|
||||
2. **Environment File Loading**
|
||||
|
||||
```bash
|
||||
# scripts/build-android.sh
|
||||
if [ "$BUILD_MODE" = "development" ]; then
|
||||
export VITE_DEFAULT_ENDORSER_API_SERVER="http://10.0.2.2:3000"
|
||||
export VITE_DEFAULT_PARTNER_API_SERVER="http://10.0.2.2:3000"
|
||||
fi
|
||||
```
|
||||
|
||||
3. **Environment File Loading**
|
||||
|
||||
```bash
|
||||
# scripts/build-web.sh
|
||||
# scripts/build-web.sh, build-android.sh, build-ios.sh, build-electron.sh
|
||||
local env_file=".env.$BUILD_MODE" # .env.development, .env.test, .env.production
|
||||
if [ -f "$env_file" ]; then
|
||||
load_env_file "$env_file"
|
||||
@@ -1746,6 +1736,18 @@ VITE_APP_SERVER=https://timesafari.app
|
||||
fi
|
||||
```
|
||||
|
||||
3. **Platform-Specific Overrides**
|
||||
|
||||
These run last so the platform address wins over the `.env` files.
|
||||
|
||||
```bash
|
||||
# scripts/build-android.sh
|
||||
if [ "$BUILD_MODE" = "development" ]; then
|
||||
export VITE_DEFAULT_ENDORSER_API_SERVER="http://10.0.2.2:3000"
|
||||
export VITE_DEFAULT_PARTNER_API_SERVER="http://10.0.2.2:3000"
|
||||
fi
|
||||
```
|
||||
|
||||
4. **Application Usage**
|
||||
|
||||
```typescript
|
||||
|
||||
Reference in New Issue
Block a user