1import { withAndroidSplashScreen } from '@expo/prebuild-config/build/plugins/unversioned/expo-splash-screen/withAndroidSplashScreen';
2import { withIosSplashScreen } from '@expo/prebuild-config/build/plugins/unversioned/expo-splash-screen/withIosSplashScreen';
3import { ConfigPlugin, createRunOncePlugin } from 'expo/config-plugins';
4
5const pkg = require('expo-splash-screen/package.json');
6
7const withSplashScreen: ConfigPlugin = (config) => {
8  // For simplicity, we'll version the unversioned code in expo-splash-screen.
9  // This adds more JS to the package overall, but the trade-off is less copying between expo-cli/expo.
10  config = withAndroidSplashScreen(config);
11  config = withIosSplashScreen(config);
12  return config;
13};
14
15export default createRunOncePlugin(withSplashScreen, pkg.name, pkg.version);
16