Skip to content

Commit 2eecfc7

Browse files
motiz88facebook-github-bot
authored andcommitted
Remove broken auto-conversion of resolver.blockList patterns
Summary: D22598095 introduced a bug that partially broke `blockList` matching on Windows by introducing unescaped `\` characters into user-provided regexes. Since this logic *never* had the intended effect of normalising `/` characters in ignore patterns to `\\`, we remove it here. Changelog: **[Fix]**: Fixed a bug in the handling of path separators in `blockList` on Windows. Reviewed By: rozele Differential Revision: D47060187 fbshipit-source-id: a238dd35f6bdb5f0a3b94c44d9edab57b5bb9654
1 parent a790b63 commit 2eecfc7

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

packages/metro/src/node-haste/DependencyGraph/createHasteMap.js

+1-6
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ import type {ConfigT} from 'metro-config/src/configTypes.flow';
1414
import MetroFileMap, {DiskCacheManager} from 'metro-file-map';
1515

1616
const ci = require('ci-info');
17-
const path = require('path');
1817

1918
function getIgnorePattern(config: ConfigT): RegExp {
2019
// For now we support both options
@@ -27,11 +26,7 @@ function getIgnorePattern(config: ConfigT): RegExp {
2726
}
2827

2928
const combine = (regexes: Array<RegExp>) =>
30-
new RegExp(
31-
regexes
32-
.map(regex => '(' + regex.source.replaceAll('/', path.sep) + ')')
33-
.join('|'),
34-
);
29+
new RegExp(regexes.map(regex => '(' + regex.source + ')').join('|'));
3530

3631
// If ignorePattern is an array, merge it into one
3732
if (Array.isArray(ignorePattern)) {

0 commit comments

Comments
 (0)