26 lines
709 B
TypeScript
26 lines
709 B
TypeScript
const { getDefaultConfig } = require('expo/metro-config');
|
|
const { FileStore } = require('metro-cache');
|
|
const path = require('path');
|
|
|
|
const config = getDefaultConfig(__dirname);
|
|
|
|
// Add resolver configuration for Node.js polyfills
|
|
config.resolver.alias = {
|
|
...config.resolver.alias,
|
|
crypto: 'react-native-get-random-values',
|
|
stream: 'readable-stream',
|
|
buffer: 'buffer',
|
|
};
|
|
|
|
|
|
config.resolver.unstable_conditionNames = ['require', 'react-native'];
|
|
|
|
// Add node_modules to resolver platforms
|
|
config.resolver.platforms = ['native', 'android', 'ios', 'web'];
|
|
|
|
// Configure metro to handle the polyfills
|
|
config.resolver.resolverMainFields = ['react-native', 'browser', 'main'];
|
|
|
|
module.exports = config;
|
|
|