Something went wrong. Try again.
This string has no description
Something went wrong. Try again.
1.3 kB · 39 lines · Created 8mo ago
JavaScript
12345678910111213141516171819202122232425262728293031323334353637383940// Learn more https://docs.expo.dev/guides/customizing-metroconst { getDefaultConfig } = require("expo/metro-config");const path = require("path");
/** @type {import('expo/metro-config').MetroConfig} */const config = getDefaultConfig(__dirname);
config.resolver.unstable_enablePackageExports = false;
// Block pnpm cache directories from being watched (not the monorepo .pnpm)config.resolver.blockList = [ // Exclude pnpm global cache/store /\/\.pnpm-store\//, // Exclude pnpm dlx cache (the original error) /\/Library\/Caches\/pnpm\/dlx\//, // General cache exclusions /\/node_modules\/.*\/node_modules\/react-native\//,];
// Add resolver to redirect expo-symbols to web shim on web platformconst originalResolveRequest = config.resolver.resolveRequest;config.resolver.resolveRequest = (context, moduleName, platform) => { // On web, redirect expo-symbols to our web shim if (platform === "web" && moduleName === "expo-symbols") { return { type: "sourceFile", filePath: path.resolve(__dirname, "polyfills/expo-symbols.web.ts"), }; }
// Use default resolution for other modules if (originalResolveRequest) { return originalResolveRequest(context, moduleName, platform); }
return context.resolveRequest(context, moduleName, platform);};
module.exports = config;