forked from react-native-webview/react-native-webview
-
Notifications
You must be signed in to change notification settings - Fork 0
/
react-native.config.js
81 lines (78 loc) · 2.13 KB
/
react-native.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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
const fs = require('fs');
const path = require('path');
const windowsProjectFile = path.join(
'node_modules',
'.generated',
'windows',
'ReactTestApp',
'ReactTestApp.vcxproj',
);
module.exports = {
dependencies: {
// Help rn-cli find and autolink this library
'react-native-webview': {
root: __dirname,
},
},
dependency: {
platforms: {
windows: {
sourceDir: 'windows',
solutionFile: 'ReactNativeWebView.sln',
projects: [
{
projectFile: 'ReactNativeWebView/ReactNativeWebView.vcxproj',
directDependency: true,
},
],
},
},
},
project: {
android: {
sourceDir: path.join('example', 'android'),
manifestPath: path.relative(
path.join(__dirname, 'example', 'android'),
path.join(
path.dirname(require.resolve('react-native-test-app/package.json')),
'android',
'app',
'src',
'main',
'AndroidManifest.xml',
),
),
},
ios: {
project: (() => {
const {
packageSatisfiesVersionRange,
} = require('react-native-test-app/scripts/configure');
if (
packageSatisfiesVersionRange(
'@react-native-community/cli-platform-ios',
'<5.0.2',
)
) {
// Prior to @react-native-community/cli-platform-ios v5.0.0,
// `project` was only used to infer `sourceDir` and `podfile`.
return 'example/ios/ReactTestApp-Dummy.xcodeproj';
}
// `sourceDir` and `podfile` detection was fixed in
// @react-native-community/cli-platform-ios v5.0.2 (see
// https://github.com/react-native-community/cli/pull/1444).
return 'node_modules/.generated/ios/ReactTestApp.xcodeproj';
})(),
},
windows: fs.existsSync(windowsProjectFile) && {
sourceDir: path.join('example', 'windows'),
solutionFile: 'WebviewExample.sln',
project: {
projectFile: path.relative(
path.join(__dirname, 'example', 'windows'),
windowsProjectFile,
),
},
},
},
};