Created
August 26, 2024 07:50
-
-
Save ozcanzaferayan/11d78a532a37809e500f50c8a384d5b4 to your computer and use it in GitHub Desktop.
Changes JVM heap size in Expo projects
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { withGradleProperties } = require("expo/config-plugins"); | |
// This plugin sets the JVM heap size to 4GB | |
module.exports = (config) => { | |
config = withGradleProperties(config, (config) => { | |
const projectGradle = config.modResults; | |
// Find index of org.gradle.jvmargs | |
const index = projectGradle.findIndex( | |
(x) => x.key === "org.gradle.jvmargs", | |
); | |
// Change value of org.gradle.jvmargs | |
projectGradle[index] = { | |
type: "property", | |
key: "org.gradle.jvmargs", | |
value: "-Xmx4096m -XX:MaxMetaspaceSize=1024m", | |
}; | |
config.modResults = projectGradle; | |
return config; | |
}); | |
return config; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment