Skip to content

Commit ce02939

Browse files
committed
Add gradle property to switch in between JS and WASM
1 parent 27641ba commit ce02939

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

build.gradle.kts

Lines changed: 3 additions & 2 deletions
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
dependsOn(webpackTask)

gradle.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@ kotlin.incremental.js.ir=true
66
kotlin.incremental.js.klib=true
77
org.jetbrains.compose.experimental.wasm.enabled=true
88
kotlin.daemon.jvmargs=-Xmx4G
9+
app.run.wasm=false

0 commit comments

Comments
 (0)