@expo/metro-config 0.6.0 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/build/ExpoMetroConfig.js
CHANGED
|
@@ -74,6 +74,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
74
74
|
|
|
75
75
|
const EXPO_DEBUG = (0, _getenv().boolish)('EXPO_DEBUG', false);
|
|
76
76
|
exports.EXPO_DEBUG = EXPO_DEBUG;
|
|
77
|
+
const EXPO_USE_METRO_WORKSPACE_ROOT = (0, _getenv().boolish)('EXPO_USE_METRO_WORKSPACE_ROOT', false);
|
|
77
78
|
const EXPO_USE_EXOTIC = (0, _getenv().boolish)('EXPO_USE_EXOTIC', false);
|
|
78
79
|
|
|
79
80
|
// Import only the types here, the values will be imported from the project, at runtime.
|
|
@@ -131,6 +132,7 @@ function getAssetPlugins(projectRoot) {
|
|
|
131
132
|
}
|
|
132
133
|
let hasWarnedAboutExotic = false;
|
|
133
134
|
function getDefaultConfig(projectRoot, options = {}) {
|
|
135
|
+
var _getWorkspaceRoot;
|
|
134
136
|
const isExotic = options.mode === 'exotic' || EXPO_USE_EXOTIC;
|
|
135
137
|
if (isExotic && !hasWarnedAboutExotic) {
|
|
136
138
|
hasWarnedAboutExotic = true;
|
|
@@ -213,7 +215,11 @@ function getDefaultConfig(projectRoot, options = {}) {
|
|
|
213
215
|
getPolyfills: () => require(_path().default.join(reactNativePath, 'rn-get-polyfills'))()
|
|
214
216
|
},
|
|
215
217
|
server: {
|
|
216
|
-
port: Number(process.env.RCT_METRO_PORT) || 8081
|
|
218
|
+
port: Number(process.env.RCT_METRO_PORT) || 8081,
|
|
219
|
+
// NOTE(EvanBacon): Moves the server root down to the monorepo root.
|
|
220
|
+
// This enables proper monorepo support for web.
|
|
221
|
+
// @ts-expect-error: not on type
|
|
222
|
+
unstable_serverRoot: EXPO_USE_METRO_WORKSPACE_ROOT ? (_getWorkspaceRoot = (0, _getModulesPaths().getWorkspaceRoot)(projectRoot)) !== null && _getWorkspaceRoot !== void 0 ? _getWorkspaceRoot : projectRoot : projectRoot
|
|
217
223
|
},
|
|
218
224
|
symbolicator: {
|
|
219
225
|
customizeFrame: frame => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExpoMetroConfig.js","names":["EXPO_DEBUG","boolish","EXPO_USE_EXOTIC","INTERNAL_CALLSITES_REGEX","RegExp","join","isUrl","value","URL","getProjectBabelConfigFile","projectRoot","resolveFrom","silent","getAssetPlugins","assetPlugins","hashAssetFilesPath","push","hasWarnedAboutExotic","getDefaultConfig","options","isExotic","mode","console","log","chalk","gray","bold","MetroConfig","importMetroConfigFromProject","reactNativePath","path","dirname","babelPresetFbjsPath","process","env","EXPO_METRO_CACHE_KEY_VERSION","String","require","version","sourceExtsConfig","isTS","isReact","isModern","sourceExts","getBareExtensions","babelConfigPath","isCustomBabelConfigDefined","resolverMainFields","watchFolders","getWatchFolders","nodeModulesPaths","getModulesPaths","reporter","metroDefaultValues","getDefaultValues","mergeConfig","resolver","platforms","assetExts","concat","filter","assetExt","includes","serializer","getModulesRunBeforeMainModule","resolve","getPolyfills","server","port","Number","RCT_METRO_PORT","symbolicator","customizeFrame","frame","file","lineNumber","column","collapse","Boolean","test","methodName","match","transformer","unstable_allowRequireContext","allowOptionalDependencies","babelTransformerPath","assetRegistryPath","loadAsync","metroOptions","defaultConfig","loadConfig","cwd"],"sources":["../src/ExpoMetroConfig.ts"],"sourcesContent":["// Copyright 2021-present 650 Industries (Expo). All rights reserved.\n\nimport { getBareExtensions } from '@expo/config/paths';\nimport chalk from 'chalk';\nimport { boolish } from 'getenv';\nimport { Reporter } from 'metro';\nimport type MetroConfig from 'metro-config';\nimport path from 'path';\nimport resolveFrom from 'resolve-from';\nimport { URL } from 'url';\n\nimport { getModulesPaths } from './getModulesPaths';\nimport { getWatchFolders } from './getWatchFolders';\nimport { importMetroConfigFromProject } from './importMetroFromProject';\n\nexport const EXPO_DEBUG = boolish('EXPO_DEBUG', false);\nconst EXPO_USE_EXOTIC = boolish('EXPO_USE_EXOTIC', false);\n\n// Import only the types here, the values will be imported from the project, at runtime.\nexport const INTERNAL_CALLSITES_REGEX = new RegExp(\n [\n '/Libraries/Renderer/implementations/.+\\\\.js$',\n '/Libraries/BatchedBridge/MessageQueue\\\\.js$',\n '/Libraries/YellowBox/.+\\\\.js$',\n '/Libraries/LogBox/.+\\\\.js$',\n '/Libraries/Core/Timers/.+\\\\.js$',\n 'node_modules/react-devtools-core/.+\\\\.js$',\n 'node_modules/react-refresh/.+\\\\.js$',\n 'node_modules/scheduler/.+\\\\.js$',\n // Metro replaces `require()` with a different method,\n // we want to omit this method from the stack trace.\n // This is akin to most React tooling.\n '/metro/.*/polyfills/require.js$',\n // Hide frames related to a fast refresh.\n '/metro/.*/lib/bundle-modules/.+\\\\.js$',\n 'node_modules/react-native/Libraries/Utilities/HMRClient.js$',\n 'node_modules/eventemitter3/index.js',\n 'node_modules/event-target-shim/dist/.+\\\\.js$',\n // Ignore the log forwarder used in the expo package.\n '/expo/build/logs/RemoteConsole.js$',\n // Improve errors thrown by invariant (ex: `Invariant Violation: \"main\" has not been registered`).\n 'node_modules/invariant/.+\\\\.js$',\n // Remove babel runtime additions\n 'node_modules/regenerator-runtime/.+\\\\.js$',\n // Remove react native setImmediate ponyfill\n 'node_modules/promise/setimmediate/.+\\\\.js$',\n // Babel helpers that implement language features\n 'node_modules/@babel/runtime/.+\\\\.js$',\n // Hide Hermes internal bytecode\n '/InternalBytecode/InternalBytecode\\\\.js$',\n // Block native code invocations\n `\\\\[native code\\\\]`,\n // Hide react-dom (web)\n 'node_modules/react-dom/.+\\\\.js$',\n ].join('|')\n);\n\nfunction isUrl(value: string): boolean {\n try {\n // eslint-disable-next-line no-new\n new URL(value);\n return true;\n } catch {\n return false;\n }\n}\n\nexport interface DefaultConfigOptions {\n mode?: 'exotic';\n}\n\nfunction getProjectBabelConfigFile(projectRoot: string): string | undefined {\n return (\n resolveFrom.silent(projectRoot, './babel.config.js') ||\n resolveFrom.silent(projectRoot, './.babelrc') ||\n resolveFrom.silent(projectRoot, './.babelrc.js')\n );\n}\n\nfunction getAssetPlugins(projectRoot: string): string[] {\n const assetPlugins: string[] = [];\n\n let hashAssetFilesPath;\n try {\n hashAssetFilesPath = resolveFrom(projectRoot, 'expo-asset/tools/hashAssetFiles');\n } catch {\n // TODO: we should warn/throw an error if the user has expo-updates installed but does not\n // have hashAssetFiles available, or if the user is in managed workflow and does not have\n // hashAssetFiles available. but in a bare app w/o expo-updates, just using dev-client,\n // it is not needed\n }\n\n if (hashAssetFilesPath) {\n assetPlugins.push(hashAssetFilesPath);\n }\n\n return assetPlugins;\n}\n\nlet hasWarnedAboutExotic = false;\n\nexport function getDefaultConfig(\n projectRoot: string,\n options: DefaultConfigOptions = {}\n): MetroConfig.InputConfigT {\n const isExotic = options.mode === 'exotic' || EXPO_USE_EXOTIC;\n\n if (isExotic && !hasWarnedAboutExotic) {\n hasWarnedAboutExotic = true;\n console.log(\n chalk.gray(\n `\\u203A Unstable feature ${chalk.bold`EXPO_USE_EXOTIC`} is enabled. Bundling may not work as expected, and is subject to breaking changes.`\n )\n );\n }\n const MetroConfig = importMetroConfigFromProject(projectRoot);\n\n const reactNativePath = path.dirname(resolveFrom(projectRoot, 'react-native/package.json'));\n\n try {\n // Set the `EXPO_METRO_CACHE_KEY_VERSION` variable for use in the custom babel transformer.\n // This hack is used because there doesn't appear to be anyway to resolve\n // `babel-preset-fbjs` relative to the project root later (in `metro-expo-babel-transformer`).\n const babelPresetFbjsPath = resolveFrom(projectRoot, 'babel-preset-fbjs/package.json');\n process.env.EXPO_METRO_CACHE_KEY_VERSION = String(require(babelPresetFbjsPath).version);\n } catch {\n // noop -- falls back to a hardcoded value.\n }\n\n const sourceExtsConfig = { isTS: true, isReact: true, isModern: false };\n const sourceExts = getBareExtensions([], sourceExtsConfig);\n\n if (isExotic) {\n // Add support for cjs (without platform extensions).\n sourceExts.push('cjs');\n }\n\n const babelConfigPath = getProjectBabelConfigFile(projectRoot);\n const isCustomBabelConfigDefined = !!babelConfigPath;\n\n const resolverMainFields: string[] = [];\n\n // Disable `react-native` in exotic mode, since library authors\n // use it to ship raw application code to the project.\n if (!isExotic) {\n resolverMainFields.push('react-native');\n }\n resolverMainFields.push('browser', 'main');\n\n const watchFolders = getWatchFolders(projectRoot);\n // TODO: nodeModulesPaths does not work with the new Node.js package.json exports API, this causes packages like uuid to fail. Disabling for now.\n const nodeModulesPaths = getModulesPaths(projectRoot);\n if (EXPO_DEBUG) {\n console.log();\n console.log(`Expo Metro config:`);\n try {\n console.log(`- Version: ${require('../package.json').version}`);\n } catch {}\n console.log(`- Extensions: ${sourceExts.join(', ')}`);\n console.log(`- React Native: ${reactNativePath}`);\n console.log(`- Babel config: ${babelConfigPath || 'babel-preset-expo (default)'}`);\n console.log(`- Resolver Fields: ${resolverMainFields.join(', ')}`);\n console.log(`- Watch Folders: ${watchFolders.join(', ')}`);\n console.log(`- Node Module Paths: ${nodeModulesPaths.join(', ')}`);\n console.log(`- Exotic: ${isExotic}`);\n console.log();\n }\n const {\n // Remove the default reporter which metro always resolves to be the react-native-community/cli reporter.\n // This prints a giant React logo which is less accessible to users on smaller terminals.\n reporter,\n ...metroDefaultValues\n } = MetroConfig.getDefaultConfig.getDefaultValues(projectRoot);\n\n // Merge in the default config from Metro here, even though loadConfig uses it as defaults.\n // This is a convenience for getDefaultConfig use in metro.config.js, e.g. to modify assetExts.\n return MetroConfig.mergeConfig(metroDefaultValues, {\n watchFolders,\n resolver: {\n resolverMainFields,\n platforms: ['ios', 'android', 'native', 'testing'],\n assetExts: metroDefaultValues.resolver.assetExts\n .concat(\n // Add default support for `expo-image` file types.\n ['heic', 'avif']\n )\n .filter((assetExt) => !sourceExts.includes(assetExt)),\n sourceExts,\n nodeModulesPaths,\n },\n serializer: {\n getModulesRunBeforeMainModule: () => [\n require.resolve(path.join(reactNativePath, 'Libraries/Core/InitializeCore')),\n // TODO: Bacon: load Expo side-effects\n ],\n getPolyfills: () => require(path.join(reactNativePath, 'rn-get-polyfills'))(),\n },\n server: {\n port: Number(process.env.RCT_METRO_PORT) || 8081,\n },\n symbolicator: {\n customizeFrame: (frame) => {\n if (frame.file && isUrl(frame.file)) {\n return {\n ...frame,\n // HACK: This prevents Metro from attempting to read the invalid file URL it sent us.\n lineNumber: null,\n column: null,\n // This prevents the invalid frame from being shown by default.\n collapse: true,\n };\n }\n let collapse = Boolean(frame.file && INTERNAL_CALLSITES_REGEX.test(frame.file));\n\n if (!collapse) {\n // This represents the first frame of the stacktrace.\n // Often this looks like: `__r(0);`.\n // The URL will also be unactionable in the app and therefore not very useful to the developer.\n if (\n frame.column === 3 &&\n frame.methodName === 'global code' &&\n frame.file?.match(/^https?:\\/\\//g)\n ) {\n collapse = true;\n }\n }\n\n return { ...(frame || {}), collapse };\n },\n },\n transformer: {\n // `require.context` support\n unstable_allowRequireContext: true,\n allowOptionalDependencies: true,\n babelTransformerPath: isExotic\n ? require.resolve('./transformer/metro-expo-exotic-babel-transformer')\n : isCustomBabelConfigDefined\n ? // If the user defined a babel config file in their project,\n // then use the default transformer.\n // Try to use the project copy before falling back on the global version\n resolveFrom.silent(projectRoot, 'metro-react-native-babel-transformer')\n : // Otherwise, use a custom transformer that uses `babel-preset-expo` by default for projects.\n require.resolve('./transformer/metro-expo-babel-transformer'),\n assetRegistryPath: 'react-native/Libraries/Image/AssetRegistry',\n assetPlugins: getAssetPlugins(projectRoot),\n },\n });\n}\n\nexport interface LoadOptions {\n config?: string;\n maxWorkers?: number;\n port?: number;\n reporter?: Reporter;\n resetCache?: boolean;\n}\n\nexport async function loadAsync(\n projectRoot: string,\n { reporter, ...metroOptions }: LoadOptions = {}\n): Promise<MetroConfig.ConfigT> {\n let defaultConfig = getDefaultConfig(projectRoot);\n if (reporter) {\n defaultConfig = { ...defaultConfig, reporter };\n }\n const MetroConfig = importMetroConfigFromProject(projectRoot);\n return await MetroConfig.loadConfig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6E,SAAS,CAC7B7E,WAAmB,EACnB;EAAE0C,QAAQ;EAAE,GAAGoC;AAA0B,CAAC,GAAG,CAAC,CAAC,EACjB;EAC9B,IAAIC,aAAa,GAAGvE,gBAAgB,CAACR,WAAW,CAAC;EACjD,IAAI0C,QAAQ,EAAE;IACZqC,aAAa,GAAG;MAAE,GAAGA,aAAa;MAAErC;IAAS,CAAC;EAChD;EACA,MAAMzB,WAAW,GAAG,IAAAC,sDAA4B,EAAClB,WAAW,CAAC;EAC7D,OAAO,MAAMiB,WAAW,CAAC+D,UAAU,CACjC;IAAEC,GAAG,EAAEjF,WAAW;IAAEA,WAAW;IAAE,GAAG8E;EAAa,CAAC,EAClDC,aAAa,CACd;AACH"}
|
|
1
|
+
{"version":3,"file":"ExpoMetroConfig.js","names":["EXPO_DEBUG","boolish","EXPO_USE_METRO_WORKSPACE_ROOT","EXPO_USE_EXOTIC","INTERNAL_CALLSITES_REGEX","RegExp","join","isUrl","value","URL","getProjectBabelConfigFile","projectRoot","resolveFrom","silent","getAssetPlugins","assetPlugins","hashAssetFilesPath","push","hasWarnedAboutExotic","getDefaultConfig","options","isExotic","mode","console","log","chalk","gray","bold","MetroConfig","importMetroConfigFromProject","reactNativePath","path","dirname","babelPresetFbjsPath","process","env","EXPO_METRO_CACHE_KEY_VERSION","String","require","version","sourceExtsConfig","isTS","isReact","isModern","sourceExts","getBareExtensions","babelConfigPath","isCustomBabelConfigDefined","resolverMainFields","watchFolders","getWatchFolders","nodeModulesPaths","getModulesPaths","reporter","metroDefaultValues","getDefaultValues","mergeConfig","resolver","platforms","assetExts","concat","filter","assetExt","includes","serializer","getModulesRunBeforeMainModule","resolve","getPolyfills","server","port","Number","RCT_METRO_PORT","unstable_serverRoot","getWorkspaceRoot","symbolicator","customizeFrame","frame","file","lineNumber","column","collapse","Boolean","test","methodName","match","transformer","unstable_allowRequireContext","allowOptionalDependencies","babelTransformerPath","assetRegistryPath","loadAsync","metroOptions","defaultConfig","loadConfig","cwd"],"sources":["../src/ExpoMetroConfig.ts"],"sourcesContent":["// Copyright 2021-present 650 Industries (Expo). All rights reserved.\n\nimport { getBareExtensions } from '@expo/config/paths';\nimport chalk from 'chalk';\nimport { boolish } from 'getenv';\nimport { Reporter } from 'metro';\nimport type MetroConfig from 'metro-config';\nimport path from 'path';\nimport resolveFrom from 'resolve-from';\nimport { URL } from 'url';\n\nimport { getModulesPaths, getWorkspaceRoot } from './getModulesPaths';\nimport { getWatchFolders } from './getWatchFolders';\nimport { importMetroConfigFromProject } from './importMetroFromProject';\n\nexport const EXPO_DEBUG = boolish('EXPO_DEBUG', false);\nconst EXPO_USE_METRO_WORKSPACE_ROOT = boolish('EXPO_USE_METRO_WORKSPACE_ROOT', false);\nconst EXPO_USE_EXOTIC = boolish('EXPO_USE_EXOTIC', false);\n\n// Import only the types here, the values will be imported from the project, at runtime.\nexport const INTERNAL_CALLSITES_REGEX = new RegExp(\n [\n '/Libraries/Renderer/implementations/.+\\\\.js$',\n '/Libraries/BatchedBridge/MessageQueue\\\\.js$',\n '/Libraries/YellowBox/.+\\\\.js$',\n '/Libraries/LogBox/.+\\\\.js$',\n '/Libraries/Core/Timers/.+\\\\.js$',\n 'node_modules/react-devtools-core/.+\\\\.js$',\n 'node_modules/react-refresh/.+\\\\.js$',\n 'node_modules/scheduler/.+\\\\.js$',\n // Metro replaces `require()` with a different method,\n // we want to omit this method from the stack trace.\n // This is akin to most React tooling.\n '/metro/.*/polyfills/require.js$',\n // Hide frames related to a fast refresh.\n '/metro/.*/lib/bundle-modules/.+\\\\.js$',\n 'node_modules/react-native/Libraries/Utilities/HMRClient.js$',\n 'node_modules/eventemitter3/index.js',\n 'node_modules/event-target-shim/dist/.+\\\\.js$',\n // Ignore the log forwarder used in the expo package.\n '/expo/build/logs/RemoteConsole.js$',\n // Improve errors thrown by invariant (ex: `Invariant Violation: \"main\" has not been registered`).\n 'node_modules/invariant/.+\\\\.js$',\n // Remove babel runtime additions\n 'node_modules/regenerator-runtime/.+\\\\.js$',\n // Remove react native setImmediate ponyfill\n 'node_modules/promise/setimmediate/.+\\\\.js$',\n // Babel helpers that implement language features\n 'node_modules/@babel/runtime/.+\\\\.js$',\n // Hide Hermes internal bytecode\n '/InternalBytecode/InternalBytecode\\\\.js$',\n // Block native code invocations\n `\\\\[native code\\\\]`,\n // Hide react-dom (web)\n 'node_modules/react-dom/.+\\\\.js$',\n ].join('|')\n);\n\nfunction isUrl(value: string): boolean {\n try {\n // eslint-disable-next-line no-new\n new URL(value);\n return true;\n } catch {\n return false;\n }\n}\n\nexport interface DefaultConfigOptions {\n mode?: 'exotic';\n}\n\nfunction getProjectBabelConfigFile(projectRoot: string): string | undefined {\n return (\n resolveFrom.silent(projectRoot, './babel.config.js') ||\n resolveFrom.silent(projectRoot, './.babelrc') ||\n resolveFrom.silent(projectRoot, './.babelrc.js')\n );\n}\n\nfunction getAssetPlugins(projectRoot: string): string[] {\n const assetPlugins: string[] = [];\n\n let hashAssetFilesPath;\n try {\n hashAssetFilesPath = resolveFrom(projectRoot, 'expo-asset/tools/hashAssetFiles');\n } catch {\n // TODO: we should warn/throw an error if the user has expo-updates installed but does not\n // have hashAssetFiles available, or if the user is in managed workflow and does not have\n // hashAssetFiles available. but in a bare app w/o expo-updates, just using dev-client,\n // it is not needed\n }\n\n if (hashAssetFilesPath) {\n assetPlugins.push(hashAssetFilesPath);\n }\n\n return assetPlugins;\n}\n\nlet hasWarnedAboutExotic = false;\n\nexport function getDefaultConfig(\n projectRoot: string,\n options: DefaultConfigOptions = {}\n): MetroConfig.InputConfigT {\n const isExotic = options.mode === 'exotic' || EXPO_USE_EXOTIC;\n\n if (isExotic && !hasWarnedAboutExotic) {\n hasWarnedAboutExotic = true;\n console.log(\n chalk.gray(\n `\\u203A Unstable feature ${chalk.bold`EXPO_USE_EXOTIC`} is enabled. Bundling may not work as expected, and is subject to breaking changes.`\n )\n );\n }\n const MetroConfig = importMetroConfigFromProject(projectRoot);\n\n const reactNativePath = path.dirname(resolveFrom(projectRoot, 'react-native/package.json'));\n\n try {\n // Set the `EXPO_METRO_CACHE_KEY_VERSION` variable for use in the custom babel transformer.\n // This hack is used because there doesn't appear to be anyway to resolve\n // `babel-preset-fbjs` relative to the project root later (in `metro-expo-babel-transformer`).\n const babelPresetFbjsPath = resolveFrom(projectRoot, 'babel-preset-fbjs/package.json');\n process.env.EXPO_METRO_CACHE_KEY_VERSION = String(require(babelPresetFbjsPath).version);\n } catch {\n // noop -- falls back to a hardcoded value.\n }\n\n const sourceExtsConfig = { isTS: true, isReact: true, isModern: false };\n const sourceExts = getBareExtensions([], sourceExtsConfig);\n\n if (isExotic) {\n // Add support for cjs (without platform extensions).\n sourceExts.push('cjs');\n }\n\n const babelConfigPath = getProjectBabelConfigFile(projectRoot);\n const isCustomBabelConfigDefined = !!babelConfigPath;\n\n const resolverMainFields: string[] = [];\n\n // Disable `react-native` in exotic mode, since library authors\n // use it to ship raw application code to the project.\n if (!isExotic) {\n resolverMainFields.push('react-native');\n }\n resolverMainFields.push('browser', 'main');\n\n const watchFolders = getWatchFolders(projectRoot);\n // TODO: nodeModulesPaths does not work with the new Node.js package.json exports API, this causes packages like uuid to fail. Disabling for now.\n const nodeModulesPaths = getModulesPaths(projectRoot);\n if (EXPO_DEBUG) {\n console.log();\n console.log(`Expo Metro config:`);\n try {\n console.log(`- Version: ${require('../package.json').version}`);\n } catch {}\n console.log(`- Extensions: ${sourceExts.join(', ')}`);\n console.log(`- React Native: ${reactNativePath}`);\n console.log(`- Babel config: ${babelConfigPath || 'babel-preset-expo (default)'}`);\n console.log(`- Resolver Fields: ${resolverMainFields.join(', ')}`);\n console.log(`- Watch Folders: ${watchFolders.join(', ')}`);\n console.log(`- Node Module Paths: ${nodeModulesPaths.join(', ')}`);\n console.log(`- Exotic: ${isExotic}`);\n console.log();\n }\n const {\n // Remove the default reporter which metro always resolves to be the react-native-community/cli reporter.\n // This prints a giant React logo which is less accessible to users on smaller terminals.\n reporter,\n ...metroDefaultValues\n } = MetroConfig.getDefaultConfig.getDefaultValues(projectRoot);\n\n // Merge in the default config from Metro here, even though loadConfig uses it as defaults.\n // This is a convenience for getDefaultConfig use in metro.config.js, e.g. to modify assetExts.\n return MetroConfig.mergeConfig(metroDefaultValues, {\n watchFolders,\n resolver: {\n resolverMainFields,\n platforms: ['ios', 'android', 'native', 'testing'],\n assetExts: metroDefaultValues.resolver.assetExts\n .concat(\n // Add default support for `expo-image` file types.\n ['heic', 'avif']\n )\n .filter((assetExt) => !sourceExts.includes(assetExt)),\n sourceExts,\n nodeModulesPaths,\n },\n serializer: {\n getModulesRunBeforeMainModule: () => [\n require.resolve(path.join(reactNativePath, 'Libraries/Core/InitializeCore')),\n // TODO: Bacon: load Expo side-effects\n ],\n getPolyfills: () => require(path.join(reactNativePath, 'rn-get-polyfills'))(),\n },\n server: {\n port: Number(process.env.RCT_METRO_PORT) || 8081,\n // NOTE(EvanBacon): Moves the server root down to the monorepo root.\n // This enables proper monorepo support for web.\n // @ts-expect-error: not on type\n unstable_serverRoot: EXPO_USE_METRO_WORKSPACE_ROOT\n ? getWorkspaceRoot(projectRoot) ?? projectRoot\n : projectRoot,\n },\n symbolicator: {\n customizeFrame: (frame) => {\n if (frame.file && isUrl(frame.file)) {\n return {\n ...frame,\n // HACK: This prevents Metro from attempting to read the invalid file URL it sent us.\n lineNumber: null,\n column: null,\n // This prevents the invalid frame from being shown by default.\n collapse: true,\n };\n }\n let collapse = Boolean(frame.file && INTERNAL_CALLSITES_REGEX.test(frame.file));\n\n if (!collapse) {\n // This represents the first frame of the stacktrace.\n // Often this looks like: `__r(0);`.\n // The URL will also be unactionable in the app and therefore not very useful to the developer.\n if (\n frame.column === 3 &&\n frame.methodName === 'global code' &&\n frame.file?.match(/^https?:\\/\\//g)\n ) {\n collapse = true;\n }\n }\n\n return { ...(frame || {}), collapse };\n },\n },\n transformer: {\n // `require.context` support\n unstable_allowRequireContext: true,\n allowOptionalDependencies: true,\n babelTransformerPath: isExotic\n ? require.resolve('./transformer/metro-expo-exotic-babel-transformer')\n : isCustomBabelConfigDefined\n ? // If the user defined a babel config file in their project,\n // then use the default transformer.\n // Try to use the project copy before falling back on the global version\n resolveFrom.silent(projectRoot, 'metro-react-native-babel-transformer')\n : // Otherwise, use a custom transformer that uses `babel-preset-expo` by default for projects.\n require.resolve('./transformer/metro-expo-babel-transformer'),\n assetRegistryPath: 'react-native/Libraries/Image/AssetRegistry',\n assetPlugins: getAssetPlugins(projectRoot),\n },\n });\n}\n\nexport interface LoadOptions {\n config?: string;\n maxWorkers?: number;\n port?: number;\n reporter?: Reporter;\n resetCache?: boolean;\n}\n\nexport async function loadAsync(\n projectRoot: string,\n { reporter, ...metroOptions }: LoadOptions = {}\n): Promise<MetroConfig.ConfigT> {\n let defaultConfig = getDefaultConfig(projectRoot);\n if (reporter) {\n defaultConfig = { ...defaultConfig, reporter };\n }\n const MetroConfig = importMetroConfigFromProject(projectRoot);\n return await MetroConfig.loadConfig(\n { cwd: projectRoot, projectRoot, ...metroOptions },\n defaultConfig\n );\n}\n"],"mappings":";;;;;;;;AAEA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAGA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAEA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAAwE;AAbxE;;AAeO,MAAMA,UAAU,GAAG,IAAAC,iBAAO,EAAC,YAAY,EAAE,KAAK,CAAC;AAAC;AACvD,MAAMC,6BAA6B,GAAG,IAAAD,iBAAO,EAAC,+BAA+B,EAAE,KAAK,CAAC;AACrF,MAAME,eAAe,GAAG,IAAAF,iBAAO,EAAC,iBA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HANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@expo/metro-config",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
4
4
|
"description": "A Metro config for running React Native projects with the Metro bundler",
|
|
5
5
|
"main": "build/ExpoMetroConfig.js",
|
|
6
6
|
"scripts": {
|
|
@@ -47,5 +47,5 @@
|
|
|
47
47
|
"publishConfig": {
|
|
48
48
|
"access": "public"
|
|
49
49
|
},
|
|
50
|
-
"gitHead": "
|
|
50
|
+
"gitHead": "c8107d57eabaedff5d53bc8036d062db12a473c8"
|
|
51
51
|
}
|