-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.config.js
More file actions
50 lines (42 loc) · 1.41 KB
/
app.config.js
File metadata and controls
50 lines (42 loc) · 1.41 KB
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
// Load environment variables based on NODE_ENV
const NODE_ENV = process.env.NODE_ENV || 'development';
// Try to load dotenv if available
try {
require('dotenv').config({ path: `.env.${NODE_ENV}` });
} catch (e) {
// dotenv not installed yet or .env file doesn't exist
console.log(`Environment file .env.${NODE_ENV} not found, using defaults`);
}
// Import modular configs
const commonConfig = require('./config/common');
const iosConfig = require('./config/ios');
const pluginsConfig = require('./config/plugins');
// Determine environment
const isProduction = NODE_ENV === 'production';
const isStaging = NODE_ENV === 'staging';
// const isDevelopment = NODE_ENV === 'development';
// Build the complete configuration
module.exports = () => ({
expo: {
...commonConfig,
ios: iosConfig(isProduction, isStaging),
...pluginsConfig,
extra: {
// API and backend configuration
apiUrl:
process.env.API_URL ||
(isProduction ? 'TODO' : isStaging ? 'TODO' : 'TODO'),
// Supabase configuration
supabaseUrl: process.env.NEXT_PUBLIC_SUPABASE_URL,
supabaseAnonKey: process.env.NEXT_PUBLIC_SUPABASE_ANON_KEY,
// // Sentry configuration
// sentryDsn: process.env.SENTRY_DSN,
// Environment info
environment: NODE_ENV,
// EAS configuration
// eas: {
// projectId: process.env.EAS_PROJECT_ID || 'your-project-id',
// },
},
},
});