forked from DogStark/PetChain-MobileApp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.config.js
More file actions
70 lines (65 loc) · 2.11 KB
/
Copy pathapp.config.js
File metadata and controls
70 lines (65 loc) · 2.11 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
/* eslint-disable @typescript-eslint/no-require-imports, no-undef */
// Load .env.<APP_ENV> via dotenv
const APP_ENV = process.env.APP_ENV ?? 'development';
require('dotenv').config({ path: `.env.${APP_ENV}` });
// Version codes: dev=1, staging=2, prod=3
const VERSION_CODE = { development: 1, staging: 2, production: 3 }[APP_ENV] ?? 1;
const APP_VERSION = '1.0.0';
const APP_NAME_MAP = {
development: 'PetChain (Dev)',
staging: 'PetChain (Staging)',
production: 'PetChain',
};
module.exports = {
expo: {
name: APP_NAME_MAP[APP_ENV] ?? 'PetChain',
slug: 'petchain-mobile',
version: APP_VERSION,
orientation: 'portrait',
icon: './assets/icon.png',
userInterfaceStyle: 'light',
splash: {
image: './assets/splash.png',
resizeMode: 'contain',
backgroundColor: '#ffffff',
},
assetBundlePatterns: ['**/*'],
ios: {
supportsTablet: true,
bundleIdentifier:
APP_ENV === 'production' ? 'app.petchain.mobile' : `app.petchain.mobile.${APP_ENV}`,
buildNumber: String(VERSION_CODE),
},
android: {
adaptiveIcon: {
foregroundImage: './assets/adaptive-icon.png',
backgroundColor: '#ffffff',
},
package: APP_ENV === 'production' ? 'app.petchain.mobile' : `app.petchain.mobile.${APP_ENV}`,
versionCode: VERSION_CODE,
},
web: {
favicon: './assets/favicon.png',
},
plugins: [
[
'@sentry/react-native/expo',
{
organization: 'petchain',
project: 'mobile-app',
},
],
],
extra: {
APP_ENV,
API_BASE_URL: process.env.API_BASE_URL ?? 'http://localhost:3000/api',
STAGING_API_URL: process.env.STAGING_API_URL ?? 'https://staging.petchain.app/api',
PROD_API_URL: process.env.PROD_API_URL ?? 'https://api.petchain.app/api',
API_TIMEOUT: process.env.API_TIMEOUT ?? '10000',
SENTRY_DSN: process.env.SENTRY_DSN ?? '',
SENTRY_ENABLE_IN_DEV: process.env.SENTRY_ENABLE_IN_DEV ?? 'false',
MAX_CACHE_SIZE: process.env.MAX_CACHE_SIZE ?? '50',
PAGINATION_LIMIT: process.env.PAGINATION_LIMIT ?? '20',
},
},
};