File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11const path = require ( 'path' ) ;
22const { getDefaultConfig, mergeConfig} = require ( '@react-native/metro-config' ) ;
3- const escape = require ( 'escape-string-regexp' ) ;
4- const exclusionList = require ( 'metro-config/src/defaults/exclusionList' ) ;
5- const pkg = require ( './package.json' ) ;
63
74const root = path . resolve ( __dirname ) ;
85const sample = path . resolve ( root , 'sample' ) ;
96
10- const modules = Object . keys ( { ...pkg . peerDependencies } ) ;
117/**
128 * Metro configuration
139 * https://reactnative.dev/docs/metro
@@ -19,15 +15,7 @@ const config = mergeConfig(getDefaultConfig(__dirname), {
1915
2016 watchFolders : [ root ] ,
2117
22- // We need to make sure that only one version is loaded for peerDependencies
23- // So we block them at the root, and alias them to the versions in example's node_modules
2418 resolver : {
25- blacklistRE : exclusionList (
26- modules . map (
27- m => new RegExp ( `^${ escape ( path . join ( root , 'node_modules' , m ) ) } \\/.*$` ) ,
28- ) ,
29- ) ,
30-
3119 extraNodeModules : {
3220 react : path . resolve ( sample , 'node_modules' , 'react' ) ,
3321 'react-native' : path . resolve ( sample , 'node_modules' , 'react-native' ) ,
You can’t perform that action at this time.
0 commit comments