Make INTERNAL_CALLSITES_REGEX work with Windows paths (#44469)

Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44469

Changelog: [General][Fixed] LogBox and Chrome DevTools stack frame collapsing patterns are now compatible with Windows file paths.

Reviewed By: GijsWeterings

Differential Revision: D57091214

fbshipit-source-id: f62d9fe7f3d4f91ed8ea07521b174989c2dd1c81
This commit is contained in:
Moti Zilberman authored and Facebook GitHub Bot committed 2024-05-08 03:52:44 -07:00
1 parent 2d8c6f591c
commit 8d0046a5e1
1 file changed
+4 -1
+4 -1
View File
@@ -35,7 +35,10 @@ const INTERNAL_CALLSITES_REGEX = new RegExp(
'/node_modules/react-refresh/.+\\.js$',
'/node_modules/scheduler/.+\\.js$',
'^\\[native code\\]$',
].join('|'),
]
// Make patterns work with both Windows and POSIX paths.
.map(pathPattern => pathPattern.replaceAll('/', '[/\\\\]'))
.join('|'),
);
export {mergeConfig} from 'metro-config';