Skip to content
Source
Sign inSign up

withAndroidGradleHeap.cjs

21 lines629 Bytes

1const { withGradleProperties } = require("expo/config-plugins");
2​
3// Expo's 2GB heap exhausts memory during :app:mergeExtDexDebug.
4const JVM_ARGS = "-Xmx4096m -XX:MaxMetaspaceSize=1024m";
5​
6module.exports = function withAndroidGradleHeap(config) {
7 return withGradleProperties(config, (nextConfig) => {
8 const properties = nextConfig.modResults.filter(
9 (item) => !(item.type === "property" && item.key === "org.gradle.jvmargs"),
10 );
11​
12 properties.push({
13 type: "property",
14 key: "org.gradle.jvmargs",
15 value: JVM_ARGS,
16 });
17​
18 nextConfig.modResults = properties;
19 return nextConfig;
20 });
21};