-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.config.js
More file actions
25 lines (22 loc) · 920 Bytes
/
Copy pathapp.config.js
File metadata and controls
25 lines (22 loc) · 920 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
/**
* Ensures `.env` is applied to `process.env` before Metro inlines `EXPO_PUBLIC_*`
* during `android` release builds (`expo export:embed` / `./gradlew assembleRelease`).
* Without this, the JS bundle can ship with the fallbacks in `src/lib/supabase.ts`
* (`http://invalid.local`), causing "Network request failed" and broken Google OAuth.
*/
const path = require('path');
const { loadProjectEnv } = require('@expo/env');
// force:true ensures .env values are loaded even if empty EXPO_PUBLIC_* vars
// are already present in the shell environment.
loadProjectEnv(path.resolve(__dirname), { silent: true, force: true });
const appJson = require('./app.json');
module.exports = {
expo: {
...appJson.expo,
extra: {
...(appJson.expo.extra || {}),
supabaseUrl: process.env.EXPO_PUBLIC_SUPABASE_URL || '',
supabaseAnonKey: process.env.EXPO_PUBLIC_SUPABASE_ANON_KEY || '',
},
},
};