-
Hi, in a Java project I'm trying to prevent native build optimizing Vue.js files in |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 3 replies
-
Can you please add some context here? Are you using Graal.js to run javascript code; what is your intent with those JavaScript files? What do you mean "optimizing Vue.js files" - including/excluding them in the built image? Native-image will only look at Java code, not JavaScript files. So without more context, we can't really help you, we need to understand what you are up to, what works and what does not work. |
Beta Was this translation helpful? Give feedback.
-
No, it is Java Graal. The Java Spring project serves static JavaScript frontend files located in resources/static/. Only the native executable throws errors in the browser. A bootJar or an IDE work fine. I made a simple example. to reproduce:
GraalVM 22.0.2+9.1 Do you have an idea where the difference could be? It is puzzling. |
Beta Was this translation helpful? Give feedback.
-
Hi, you are not providing any configuration for the ahead-of-time compilation. Native-Image needs to understand what e.g. resources you want to have included. The tracing agent can provide that information based on a test run that covers the relevant usecases: I got that working by adding this to the build.gradle:
The content of the tracing dir I then copied to |
Beta Was this translation helpful? Give feedback.
Hi,
you are not providing any configuration for the ahead-of-time compilation. Native-Image needs to understand what e.g. resources you want to have included.
The tracing agent can provide that information based on a test run that covers the relevant usecases:
https://www.graalvm.org/latest/reference-manual/native-image/metadata/AutomaticMetadataCollection/
The output won't be perfect and will certainly need manual tuning.
I got that working by adding this to the build.gradle:
The content of the tracing dir I then copied to
build/resources/aot/META-INF/native-image
- there is probably a better way to do thi…