File tree Expand file tree Collapse file tree 2 files changed +23
-0
lines changed Expand file tree Collapse file tree 2 files changed +23
-0
lines changed Original file line number Diff line number Diff line change
1
+ import org.jetbrains.kotlin.gradle.targets.js.nodejs.NodeJsRootExtension
2
+ import org.jetbrains.kotlin.gradle.targets.js.nodejs.NodeJsRootPlugin
3
+ import org.jetbrains.kotlin.gradle.targets.js.npm.tasks.KotlinNpmInstallTask
4
+
1
5
plugins {
2
6
@Suppress(" DSL_SCOPE_VIOLATION" )
3
7
alias(libs.plugins.android.library) apply false
@@ -22,3 +26,14 @@ allprojects {
22
26
google()
23
27
}
24
28
}
29
+
30
+ // TODO: Remove once default NodeJS version supports wasm
31
+ plugins.withType<NodeJsRootPlugin > {
32
+ extensions.configure(NodeJsRootExtension ::class ) {
33
+ nodeVersion = " 21.0.0-v8-canary20231019bd785be450"
34
+ nodeDownloadBaseUrl = " https://nodejs.org/download/v8-canary"
35
+ }
36
+ tasks.withType<KotlinNpmInstallTask > {
37
+ args.add(" --ignore-engines" )
38
+ }
39
+ }
Original file line number Diff line number Diff line change 1
1
import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi
2
+ import org.jetbrains.kotlin.gradle.targets.js.dsl.ExperimentalWasmDsl
2
3
3
4
plugins {
4
5
@Suppress(" DSL_SCOPE_VIOLATION" )
@@ -20,6 +21,7 @@ kotlin {
20
21
withJs()
21
22
group(" linux" )
22
23
group(" mingw" )
24
+ withWasm()
23
25
}
24
26
}
25
27
}
@@ -50,6 +52,12 @@ kotlin {
50
52
linuxArm64()
51
53
linuxX64()
52
54
mingwX64()
55
+ @OptIn(ExperimentalWasmDsl ::class )
56
+ wasmJs {
57
+ browser()
58
+ nodejs()
59
+ d8()
60
+ }
53
61
// endregion
54
62
55
63
targets.all {
You can’t perform that action at this time.
0 commit comments