1"use strict"; 2 3Object.defineProperty(exports, "__esModule", { 4 value: true 5}); 6exports.getPrebuildConfigAsync = getPrebuildConfigAsync; 7 8function _config() { 9 const data = require("@expo/config"); 10 11 _config = function () { 12 return data; 13 }; 14 15 return data; 16} 17 18function _getAutolinkedPackages() { 19 const data = require("./getAutolinkedPackages"); 20 21 _getAutolinkedPackages = function () { 22 return data; 23 }; 24 25 return data; 26} 27 28function _withDefaultPlugins() { 29 const data = require("./plugins/withDefaultPlugins"); 30 31 _withDefaultPlugins = function () { 32 return data; 33 }; 34 35 return data; 36} 37 38async function getPrebuildConfigAsync(projectRoot, props) { 39 const autolinkedModules = await (0, _getAutolinkedPackages().getAutolinkedPackagesAsync)(projectRoot, props.platforms); 40 return getPrebuildConfig(projectRoot, { ...props, 41 autolinkedModules 42 }); 43} 44 45function getPrebuildConfig(projectRoot, { 46 platforms, 47 bundleIdentifier, 48 packageName, 49 autolinkedModules, 50 expoUsername 51}) { 52 // let config: ExpoConfig; 53 let { 54 exp: config, 55 ...rest 56 } = (0, _config().getConfig)(projectRoot, { 57 skipSDKVersionRequirement: true, 58 isModdedConfig: true 59 }); 60 61 if (autolinkedModules) { 62 if (!config._internal) { 63 config._internal = {}; 64 } 65 66 config._internal.autolinkedModules = autolinkedModules; 67 } 68 69 const resolvedExpoUsername = typeof expoUsername === 'function' ? expoUsername(config) : // If the user didn't pass a username then fallback on the static cached username. 70 expoUsername !== null && expoUsername !== void 0 ? expoUsername : (0, _config().getAccountUsername)(config); // Add all built-in plugins first because they should take 71 // priority over the unversioned plugins. 72 73 config = (0, _withDefaultPlugins().withVersionedExpoSDKPlugins)(config, { 74 expoUsername: resolvedExpoUsername 75 }); 76 config = (0, _withDefaultPlugins().withLegacyExpoPlugins)(config); 77 78 if (platforms.includes('ios')) { 79 var _ref; 80 81 if (!config.ios) config.ios = {}; 82 config.ios.bundleIdentifier = (_ref = bundleIdentifier !== null && bundleIdentifier !== void 0 ? bundleIdentifier : config.ios.bundleIdentifier) !== null && _ref !== void 0 ? _ref : `com.placeholder.appid`; // Add all built-in plugins 83 84 config = (0, _withDefaultPlugins().withIosExpoPlugins)(config, { 85 bundleIdentifier: config.ios.bundleIdentifier 86 }); 87 } 88 89 if (platforms.includes('android')) { 90 var _ref2; 91 92 if (!config.android) config.android = {}; 93 config.android.package = (_ref2 = packageName !== null && packageName !== void 0 ? packageName : config.android.package) !== null && _ref2 !== void 0 ? _ref2 : `com.placeholder.appid`; // Add all built-in plugins 94 95 config = (0, _withDefaultPlugins().withAndroidExpoPlugins)(config, { 96 package: config.android.package 97 }); 98 } 99 100 return { 101 exp: config, 102 ...rest 103 }; 104} 105//# sourceMappingURL=getPrebuildConfig.js.map