Skip to content

Commit c4bcca6

Browse files
vincentriemerfacebook-github-bot
authored andcommitted
Whitelist react-native-dom in haste/cli config defaults (#20393)
Summary: This adds `react-native-dom` to `hasteImpl.js` because it's not currently possible to configure it from an out of tree platform. Also adds the relevant `providesModuleNodeModules` and `platforms` values to the default RN CLI config. This should hopefully be able to be removed once better support for out of tree platforms is implemented. Pull Request resolved: #20393 Differential Revision: D9007186 Pulled By: hramos fbshipit-source-id: 67077860dc1fb191d80300fb980599ed76d5f91c
1 parent 253b29d commit c4bcca6

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

jest/hasteImpl.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ const path = require('path');
1515
const ROOTS = [
1616
path.resolve(__dirname, '..') + path.sep,
1717
path.resolve(__dirname, '../../react-native-windows') + path.sep,
18+
path.resolve(__dirname, '../../react-native-dom') + path.sep,
1819
];
1920

2021
const BLACKLISTED_PATTERNS /*: Array<RegExp> */ = [
@@ -36,7 +37,7 @@ const NAME_REDUCERS /*: Array<[RegExp, string]> */ = [
3637
// strip .js/.js.flow suffix
3738
[/^(.*)\.js(\.flow)?$/, '$1'],
3839
// strip .android/.ios/.native/.web suffix
39-
[/^(.*)\.(android|ios|native|web|windows)$/, '$1'],
40+
[/^(.*)\.(android|ios|native|web|windows|dom)$/, '$1'],
4041
];
4142

4243
const haste = {

local-cli/core/index.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -70,11 +70,11 @@ const defaultConfig = {
7070
hasteImplModulePath: require.resolve('../../jest/hasteImpl'),
7171

7272
getPlatforms(): Array<string> {
73-
return ['ios', 'android', 'windows', 'web'];
73+
return ['ios', 'android', 'windows', 'web', 'dom'];
7474
},
7575

7676
getProvidesModuleNodeModules(): Array<string> {
77-
return ['react-native', 'react-native-windows'];
77+
return ['react-native', 'react-native-windows', 'react-native-dom'];
7878
},
7979
};
8080

0 commit comments

Comments
 (0)