Skip to content

Commit

Permalink
Remove broken auto-conversion of resolver.blockList patterns
Browse files Browse the repository at this point in the history
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
  • Loading branch information
motiz88 authored and facebook-github-bot committed Jun 27, 2023
1 parent a790b63 commit 2eecfc7
Showing 1 changed file with 1 addition and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import type {ConfigT} from 'metro-config/src/configTypes.flow';
import MetroFileMap, {DiskCacheManager} from 'metro-file-map';

const ci = require('ci-info');
const path = require('path');

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

const combine = (regexes: Array<RegExp>) =>
new RegExp(
regexes
.map(regex => '(' + regex.source.replaceAll('/', path.sep) + ')')
.join('|'),
);
new RegExp(regexes.map(regex => '(' + regex.source + ')').join('|'));

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

0 comments on commit 2eecfc7

Please sign in to comment.