Externs Configuration Not Preventing Code Obfuscation #275
Replies: 1 comment 4 replies
-
Can you provide an example showing this? My very basic understanding is that what you have here isn't going to be enough, assuming MButton is a Java class. At the very least, I think you will need two other pieces:
Java semantics are "respected" in your j2cl-compiled app by not actually loading any classes or running any code when your JS file is loaded by the browser. Even if you explicitly use MButton, the generated .js files from j2cl are closure modules, so something needs to explicitly import and use it from JS. Likely it could be enough to tack on a MButton.native.js that assigns |
Beta Was this translation helpful? Give feedback.
-
Description:
I'm encountering an issue with the j2cl-maven-plugin where the externs configuration is not preventing code obfuscation as expected.
Steps to Reproduce:
externs.js
file in the Java root directory with the following content:Current Behavior:
The
MButton
class and its methods are still being obfuscated in the output, despite being defined in the externs file.Expected Behavior:
The
MButton
class and itsgetText
method should be preserved in their original form without obfuscation, as specified in the externs file.Environment:
Additional Context:
I'm following the documentation for configuring externs, but the configuration doesn't seem to be taking effect. Are there any additional steps or configuration settings required to properly implement externs?
Configuration Details:
Please share any relevant parts of your Maven configuration if possible:
Thank you for your help in resolving this issue.
Beta Was this translation helpful? Give feedback.
All reactions