forked from react-navigation/react-navigation
-
Notifications
You must be signed in to change notification settings - Fork 0
/
rn-cli.config.js
44 lines (35 loc) · 1.24 KB
/
rn-cli.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
// Copyright 2004-present Facebook. All Rights Reserved.
/**
* React Native CLI configuration file.
* Make it possible to run examples by starting the packager
* from the root of this repo. That way the packager can
* see both the react-navigation code and the examples.
*/
const blacklist = require('react-native/packager/blacklist');
const config = require('react-native/packager/rn-cli.config');
const examples = [
'NavigationPlayground',
'HelloHybrid',
'LinkingExample',
'Chat',
];
config.getBlacklist = () => (
examples.reduce((a, example) => a.concat([
...config.getBlacklistForExample(example),
new RegExp(`examples/${example}/__exponent/(.*)`),
]), [])
);
config.getBlacklistForExample = (example) => ([
...examples.filter(x => x !== example).map(x => new RegExp(`examples/${x}/node_modules/react-native/(.*)`)),
...examples.filter(x => x !== example).map(x => new RegExp(`examples/${x}/node_modules/react/(.*)`)),
new RegExp(`examples/${example}/node_modules/react-navigation/(.*)`),
]);
config.getBlacklistRE = () => blacklist(config.getBlacklist());
config.getProjectRoots = () => getRoots();
config.getAssetRoots = () => getRoots();
function getRoots() {
return [
__dirname,
];
}
module.exports = config;