What is the recommended way to use `jsBrowserDevel...
# compose-web
n
What is the recommended way to use
jsBrowserDevelopmentRun
to effectively run Compose HTML apps with IDEA CE in development mode? (Without using additional 3rd-party frameworks like kobweb.) When I start the JS app it seems to invoke the "development mode" Gradle tasks:
Copy code
> Task ...:compileDevelopmentExecutableKotlinJs
> Task ...:jsDevelopmentExecutableCompileSync
But later when I compile the code using CTRL+F9 after a code change, the following (very slow) "production mode" tasks are executed:
Copy code
> Task ...:compileProductionExecutableKotlinJs
> Task ...:jsProductionExecutableCompileSync
> Task ...:jsBrowserProductionWebpack
> Task ...:jsBrowserDistribution
> Task ...:assemble
I perform a "full build" because I make modifications in server side code as well. For similar reasons, I don't want to use
--continuous
for running the webapp. Thanks.
d
I'm not sure but my guess is CTRL+F9 runs
./gradlew build
which probably does everything. Have you tried just creating a run configuration targeting
jsBrowserDevelopmentRun
and using that?
(I think if you have a particular run configuration selected in IJ, you use SHIFT+F10 to run it or SHIFT+F9 to debug it)
If you want to do more than just
jsBrowserDevelopmentRun
you can probably just create your own gradle task in your build script which depends on all the other tasks you care about and then make a run configuration based on that.
n
just create your own gradle task in your build script
Good idea, thanks!
👍 1
my guess is CTRL+F9 runs
./gradlew build
It seems to run a dynamically generated Gradle command, listing all projects and executing
assemble
,
classes
, etc. for all of them, like:
Copy code
19:55:13: Executing ':assemble :PRJ1:testClasses :PRJ2:assemble :PRJ3:classes ...'
(I don't get why it doesn't let Gradle to handle transitive tasks...)
🤷 1