For years now, I've suffered the constant warning ...
# javascript
l
For years now, I've suffered the constant warning that "you're not supposed to have multiple js targets in a single module". So, now that I'm migrating to Java 25, I figured I'd migrate this as well. I've extracted all the different js targets from my
build.gradle
into differnet submodules, but now I have a problem: How do I run this in development mode? In short: I have a main JS file that runs the single-page application, and then I have two more JS files that now has to come from other modules: One is a webworker that runs as part of the application, and the second is a separate js file that is very large and is loaded on-demand when its functionality is needed. Is it not possible to bring all of these js files into the main client application so they're available in developer mode? This was pretty easy when having multiple js targets.
t
1. In both cases you don't need separate subprojects 2. All 3 parts can share common logic - user will load less as result
Worker example is here 😉
Lazy functions can be used to solve second problem