Build-time flag to exclude Icu4j
When compiling JVM polyglot projects that include GraalJS using native-image, a somewhat large chunk (~8MB) of the resulting binary comes from Icu4j.
This mostly consists of locale-specific data, and is mostly/exclusively used for the JS Intl. API. Since support for this API can be disabled, it'd be great if there was a corresponding flag to exclude Icu4j from the build.
I think you could use the native-image flag --exclude-config to exclude the ICU4J resource files from the image (saving ~8MB).
Something like this should work:
…/native-image […] --initialize-at-run-time=org.graalvm.shadowed.com.ibm.icu --exclude-config "icu4j.*.jar" "META-INF\\/native-image\\/org.graalvm.shadowed\\/icu4j\\/native-image\\.properties"
Obviously, excluding icu4j resources will break the Intl API and related functionality, so you should disable that. The affected JS built-in functions should throw a runtime error.