I’d like to know if there’s a step in React4XP (based on the starter repo) that builds/compiles the files in assets/js. I have a preact code in there which appears processed in the build/ dir after the gradlew build. It’s odd that, while testing an example page locally, the original file is the one referenced after portalLib.assetUrl, while in the server (running the same XP version) we get the processed file (which throws a breaking error).
We don’t have code in React4XP starter that processes client-side JS assets, but this is a matter of correctly setting up your Webpack build. Just keep in mind that Webpack won’t understand references to portalLib.assetUrl, you will have to use include/require inside JS files to build a chain of dependencies that Webpack will understand.
Here’s config we are using in another project based on React4XP: