Skip to content

Commit bef26f8

Browse files
committed
Add gradle property to switch in between JS and WASM
1 parent fedc804 commit bef26f8

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

build.gradle.kts

+3-2
Original file line numberDiff line numberDiff line change
@@ -100,12 +100,13 @@ compose.experimental {
100100

101101
// include JS artifacts in any JAR we generate
102102
tasks.named<Jar>("jvmJar").configure {
103+
val taskPrefix = if (project.properties.get("app.run.wasm") == "true") "wasmJs" else "js"
103104
val taskName = if (project.hasProperty("isProduction")
104105
|| project.gradle.startParameter.taskNames.contains("installDist")
105106
) {
106-
"wasmJsBrowserProductionWebpack"
107+
"${taskPrefix}BrowserProductionWebpack"
107108
} else {
108-
"wasmJsBrowserDevelopmentWebpack"
109+
"${taskPrefix}BrowserDevelopmentWebpack"
109110
}
110111
val webpackTask = tasks.named<KotlinWebpack>(taskName)
111112
from(webpackTask.map { it.outputDirectory }) // bring output file along into the JAR

gradle.properties

+1
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@ kotlin.code.style=official
22
kotlin.js.compiler=ir
33
org.jetbrains.compose.experimental.wasm.enabled=true
44
kotlin.daemon.jvmargs=-Xmx4G
5+
app.run.wasm=false

0 commit comments

Comments
 (0)