Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import 'dotenv/config';
- import type { ExpoConfig } from 'expo/config';
- const EAS_PROJECT_ID = '96126432-cce0-433b-bf31-7e3761cea302';
- const PROJECT_SLUG = 'gigbot';
- const APP_NAME = 'Gigbot';
- const BUNDLE_IDENTIFIER = 'com.gigbot';
- const PACKAGE_NAME = 'com.gigbot';
- const ICON = './assets/images/appstore.png';
- const ADAPTIVE_ICON = './assets/images/playstore.png';
- const SCHEME = 'gigbot';
- // Get the profile from EAS (if we are building with eas build)
- const defineConfig = (): ExpoConfig => {
- console.log(
- '⚙️ Building app for environment:',
- process.env.EXPO_PUBLIC_APP_ENV,
- );
- const {
- name,
- bundleIdentifier,
- icon,
- adaptiveIcon,
- packageName,
- scheme,
- googleServicesFile,
- } = getDynamicAppConfig(
- (process.env.EXPO_PUBLIC_APP_ENV as
- | 'development'
- | 'preview'
- | 'production') || 'development',
- );
- return {
- name,
- slug: PROJECT_SLUG,
- version: '1.0.0',
- orientation: 'portrait',
- icon,
- scheme,
- userInterfaceStyle: 'automatic',
- newArchEnabled: true,
- updates: {
- url: `https://u.expo.dev/${EAS_PROJECT_ID}`,
- fallbackToCacheTimeout: 0,
- },
- runtimeVersion: {
- policy: 'appVersion',
- },
- ios: {
- supportsTablet: true,
- bundleIdentifier,
- },
- android: {
- package: packageName,
- adaptiveIcon: {
- foregroundImage: adaptiveIcon,
- backgroundColor: '#7B28CA',
- },
- edgeToEdgeEnabled: true,
- googleServicesFile,
- },
- web: {
- bundler: 'metro',
- output: 'static',
- favicon: './assets/images/icon.png',
- },
- experiments: {
- typedRoutes: true,
- },
- extra: {
- eas: {
- projectId: EAS_PROJECT_ID,
- },
- },
- plugins: [
- 'expo-router',
- 'expo-secure-store',
- 'expo-localization',
- 'expo-web-browser',
- [
- 'expo-splash-screen',
- {
- image: './assets/images/splash.gif',
- imageWidth: 200,
- contentFit: 'contain',
- backgroundColor: '#7B28CA',
- },
- ],
- ],
- };
- };
- const getDynamicAppConfig = (
- environment: 'development' | 'preview' | 'production',
- ) => {
- if (environment === 'production') {
- return {
- name: APP_NAME,
- bundleIdentifier: BUNDLE_IDENTIFIER,
- packageName: PACKAGE_NAME,
- icon: ICON,
- adaptiveIcon: ADAPTIVE_ICON,
- scheme: SCHEME,
- googleServicesFile: './google-services/google-services-production.json',
- };
- }
- if (environment === 'preview') {
- return {
- name: `${APP_NAME} Preview`,
- bundleIdentifier: `${BUNDLE_IDENTIFIER}.preview`,
- packageName: `${PACKAGE_NAME}.preview`,
- icon: ICON,
- adaptiveIcon: ADAPTIVE_ICON,
- scheme: `${SCHEME}-prev`,
- googleServicesFile: './google-services/google-services-preview.json',
- };
- }
- return {
- name: `${APP_NAME} Development`,
- bundleIdentifier: `${BUNDLE_IDENTIFIER}.dev`,
- packageName: `${PACKAGE_NAME}.dev`,
- icon: ICON,
- adaptiveIcon: ADAPTIVE_ICON,
- scheme: `${SCHEME}-dev`,
- googleServicesFile: './google-services/google-services-dev.json',
- };
- };
- export default defineConfig;
Advertisement
Add Comment
Please, Sign In to add comment