Initial commit of template
This commit is contained in:
25
metro.config.ts
Normal file
25
metro.config.ts
Normal file
@@ -0,0 +1,25 @@
|
||||
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;
|
||||
|
||||
Reference in New Issue
Block a user