mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
[DevTools] Fix moduleNameMapper Order in DevTools Config #24602)
We need the regression config moduleNameMapper to come before the current moduleNameMapper so when it tries to map "/^react-dom\/([^/]+)$/ it doesn't get confused. The reason is because order in which the mappings are defined matters. Patterns are checked one by one until one fits, and the most specific rule should be listed first.
This commit is contained in:
@@ -734,7 +734,7 @@ describe('ProfilingCache', () => {
|
||||
}
|
||||
});
|
||||
|
||||
// @reactVersion >= 16.9
|
||||
// @reactVersion >= 18.0
|
||||
it('should calculate durations based on actual children (not filtered children)', () => {
|
||||
store.componentFilters = [utils.createDisplayNameFilter('^Parent$')];
|
||||
|
||||
|
||||
@@ -51,8 +51,8 @@ moduleNameMapper['^react-reconciler/([^/]+)$'] =
|
||||
module.exports = Object.assign({}, baseConfig, {
|
||||
// Redirect imports to the compiled bundles
|
||||
moduleNameMapper: {
|
||||
...moduleNameMapper,
|
||||
...devtoolsRegressionConfig.moduleNameMapper,
|
||||
...moduleNameMapper,
|
||||
},
|
||||
// Don't run bundle tests on -test.internal.* files
|
||||
testPathIgnorePatterns: ['/node_modules/', '-test.internal.js$'],
|
||||
|
||||
Reference in New Issue
Block a user