File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -2,8 +2,12 @@ const { getDefaultConfig } = require('expo/metro-config');
22// const exclusionList = require('metro-config/src/defaults/exclusionList');
33const path = require ( 'path' ) ;
44
5+ // Helper to safely embed a path in RegExp
6+ const escapeRegExp = ( s ) => s . replace ( / [ | \\ { } ( ) [ \] ^ $ + * ? . ] / g, '\\$&' ) ;
7+
58const projectRoot = __dirname ;
69const workspaceRoot = path . resolve ( __dirname , '..' ) ;
10+ const parentNodeModules = path . join ( workspaceRoot , 'node_modules' ) ;
711
812const config = getDefaultConfig ( projectRoot ) ;
913
@@ -13,11 +17,12 @@ config.resolver = {
1317 ...config . resolver ,
1418 nodeModulesPaths : [
1519 path . join ( projectRoot , 'node_modules' ) ,
16- path . join ( workspaceRoot , 'node_modules' ) ,
1720 ] ,
1821
1922 // Ignore common explosion points
2023 blockList : [
24+ new RegExp ( `^${ escapeRegExp ( parentNodeModules ) } [/\\\\].*` ) ,
25+
2126 // avoid triply nested node_modules to resolve issue with using a local copy of the module
2227 / .* \/ n o d e _ m o d u l e s \/ .* \/ n o d e _ m o d u l e s \/ .* \/ n o d e _ m o d u l e s \/ .* / ,
2328
You can’t perform that action at this time.
0 commit comments