0x0x230x

Untitled

Jul 3rd, 2025
21
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.23 KB | None | 0 0
  1. import 'dotenv/config';
  2. import type { ExpoConfig } from 'expo/config';
  3.  
  4. const EAS_PROJECT_ID = '96126432-cce0-433b-bf31-7e3761cea302';
  5. const PROJECT_SLUG = 'gigbot';
  6. const APP_NAME = 'Gigbot';
  7. const BUNDLE_IDENTIFIER = 'com.gigbot';
  8. const PACKAGE_NAME = 'com.gigbot';
  9. const ICON = './assets/images/appstore.png';
  10. const ADAPTIVE_ICON = './assets/images/playstore.png';
  11. const SCHEME = 'gigbot';
  12.  
  13. // Get the profile from EAS (if we are building with eas build)
  14.  
  15. const defineConfig = (): ExpoConfig => {
  16. console.log(
  17. '⚙️ Building app for environment:',
  18. process.env.EXPO_PUBLIC_APP_ENV,
  19. );
  20.  
  21. const {
  22. name,
  23. bundleIdentifier,
  24. icon,
  25. adaptiveIcon,
  26. packageName,
  27. scheme,
  28. googleServicesFile,
  29. } = getDynamicAppConfig(
  30. (process.env.EXPO_PUBLIC_APP_ENV as
  31. | 'development'
  32. | 'preview'
  33. | 'production') || 'development',
  34. );
  35.  
  36. return {
  37. name,
  38. slug: PROJECT_SLUG,
  39. version: '1.0.0',
  40. orientation: 'portrait',
  41. icon,
  42. scheme,
  43. userInterfaceStyle: 'automatic',
  44. newArchEnabled: true,
  45. updates: {
  46. url: `https://u.expo.dev/${EAS_PROJECT_ID}`,
  47. fallbackToCacheTimeout: 0,
  48. },
  49. runtimeVersion: {
  50. policy: 'appVersion',
  51. },
  52. ios: {
  53. supportsTablet: true,
  54. bundleIdentifier,
  55. },
  56. android: {
  57. package: packageName,
  58. adaptiveIcon: {
  59. foregroundImage: adaptiveIcon,
  60. backgroundColor: '#7B28CA',
  61. },
  62. edgeToEdgeEnabled: true,
  63. googleServicesFile,
  64. },
  65. web: {
  66. bundler: 'metro',
  67. output: 'static',
  68. favicon: './assets/images/icon.png',
  69. },
  70. experiments: {
  71. typedRoutes: true,
  72. },
  73. extra: {
  74. eas: {
  75. projectId: EAS_PROJECT_ID,
  76. },
  77. },
  78. plugins: [
  79. 'expo-router',
  80. 'expo-secure-store',
  81. 'expo-localization',
  82. 'expo-web-browser',
  83. [
  84. 'expo-splash-screen',
  85. {
  86. image: './assets/images/splash.gif',
  87. imageWidth: 200,
  88. contentFit: 'contain',
  89. backgroundColor: '#7B28CA',
  90. },
  91. ],
  92. ],
  93. };
  94. };
  95.  
  96. const getDynamicAppConfig = (
  97. environment: 'development' | 'preview' | 'production',
  98. ) => {
  99. if (environment === 'production') {
  100. return {
  101. name: APP_NAME,
  102. bundleIdentifier: BUNDLE_IDENTIFIER,
  103. packageName: PACKAGE_NAME,
  104. icon: ICON,
  105. adaptiveIcon: ADAPTIVE_ICON,
  106. scheme: SCHEME,
  107. googleServicesFile: './google-services/google-services-production.json',
  108. };
  109. }
  110.  
  111. if (environment === 'preview') {
  112. return {
  113. name: `${APP_NAME} Preview`,
  114. bundleIdentifier: `${BUNDLE_IDENTIFIER}.preview`,
  115. packageName: `${PACKAGE_NAME}.preview`,
  116. icon: ICON,
  117. adaptiveIcon: ADAPTIVE_ICON,
  118. scheme: `${SCHEME}-prev`,
  119. googleServicesFile: './google-services/google-services-preview.json',
  120. };
  121. }
  122.  
  123. return {
  124. name: `${APP_NAME} Development`,
  125. bundleIdentifier: `${BUNDLE_IDENTIFIER}.dev`,
  126. packageName: `${PACKAGE_NAME}.dev`,
  127. icon: ICON,
  128. adaptiveIcon: ADAPTIVE_ICON,
  129. scheme: `${SCHEME}-dev`,
  130. googleServicesFile: './google-services/google-services-dev.json',
  131. };
  132. };
  133.  
  134. export default defineConfig;
  135.  
Advertisement
Add Comment
Please, Sign In to add comment