-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
35 lines (31 loc) · 1.05 KB
/
index.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
const { withGradleProperties } = require("@expo/config-plugins")
const RN_76_GRADLE_PROPERTIES = {
"android.enableJetifier": true,
"org.gradle.jvmargs": "-Xmx4096m -XX:MaxMetaspaceSize=512m"
}
function updateGradleProperties(config, properties) {
return withGradleProperties(config, exportedConfig => {
Object.entries(properties).forEach(([key, value]) => {
const keyIdx = exportedConfig.modResults.findIndex(property => property.key === key)
if (keyIdx === -1) {
exportedConfig.modResults.push({
type: "property",
key,
value
})
} else {
exportedConfig.modResults.splice(keyIdx, 1, {
type: 'property',
key,
value,
});
}
})
return exportedConfig
})
}
function withConfigPlugin(config) {
config = updateGradleProperties(config, RN_76_GRADLE_PROPERTIES)
return config
}
module.exports = withConfigPlugin