-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.config.js
More file actions
42 lines (37 loc) · 1.08 KB
/
Copy pathapp.config.js
File metadata and controls
42 lines (37 loc) · 1.08 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
const appJson = require('./app.json');
const androidGoogleMapsApiKey = process.env.EXPO_PUBLIC_ANDROID_GOOGLE_MAPS_API_KEY;
const digitransitApiKey = process.env.EXPO_PUBLIC_DIGITRANSIT_API_KEY;
const digitransitApiUrl = process.env.EXPO_PUBLIC_DIGITRANSIT_API_URL;
const iosGoogleMapsApiKey = process.env.EXPO_PUBLIC_IOS_GOOGLE_MAPS_API_KEY;
const mapboxPublicToken = process.env.EXPO_PUBLIC_MAPBOX_PUBLIC_TOKEN;
const baseExpoConfig = appJson.expo;
const plugins = (baseExpoConfig.plugins ?? []).filter((plugin) => {
if (typeof plugin === 'string') {
return plugin !== 'react-native-maps';
}
return plugin[0] !== 'react-native-maps';
});
if (androidGoogleMapsApiKey || iosGoogleMapsApiKey) {
plugins.push([
'react-native-maps',
{
androidGoogleMapsApiKey,
iosGoogleMapsApiKey,
},
]);
}
module.exports = {
expo: {
...baseExpoConfig,
extra: {
...(baseExpoConfig.extra ?? {}),
publicRuntimeConfig: {
digitransitApiKey,
digitransitApiUrl,
iosGoogleMapsApiKey,
mapboxPublicToken,
},
},
plugins,
},
};