Simplify configuration of KotlinNpmInstallTask

This commit is contained in:
Michael Bull 2024-03-03 13:57:22 +00:00
parent 76a69a50e8
commit c3d28ed771
2 changed files with 13 additions and 12 deletions

View File

@ -1,3 +1,6 @@
import org.jetbrains.kotlin.gradle.targets.js.nodejs.NodeJsRootExtension
import org.jetbrains.kotlin.gradle.targets.js.npm.tasks.KotlinNpmInstallTask
plugins { plugins {
kotlin("multiplatform") kotlin("multiplatform")
} }
@ -64,3 +67,13 @@ tasks.withType<Jar> {
into("META-INF") into("META-INF")
} }
} }
/* https://youtrack.jetbrains.com/issue/KT-63014/Running-tests-with-wasmJs-in-1.9.20-requires-Chrome-Canary#focus=Comments-27-8321383.0-0 */
rootProject.the<NodeJsRootExtension>().apply {
nodeVersion = "21.0.0-v8-canary202309143a48826a08"
nodeDownloadBaseUrl = "https://nodejs.org/download/v8-canary"
}
rootProject.tasks.withType<KotlinNpmInstallTask> {
args.add("--ignore-engines")
}

View File

@ -1,6 +1,4 @@
import org.jetbrains.kotlin.gradle.targets.js.dsl.ExperimentalWasmDsl import org.jetbrains.kotlin.gradle.targets.js.dsl.ExperimentalWasmDsl
import org.jetbrains.kotlin.gradle.targets.js.nodejs.NodeJsRootExtension
import org.jetbrains.kotlin.gradle.targets.js.npm.tasks.KotlinNpmInstallTask
plugins { plugins {
`maven-publish` `maven-publish`
@ -25,13 +23,3 @@ kotlin {
nodejs() nodejs()
} }
} }
/* https://youtrack.jetbrains.com/issue/KT-63014/Running-tests-with-wasmJs-in-1.9.20-requires-Chrome-Canary#focus=Comments-27-8321383.0-0 */
rootProject.the<NodeJsRootExtension>().apply {
nodeVersion = "21.0.0-v8-canary202309143a48826a08"
nodeDownloadBaseUrl = "https://nodejs.org/download/v8-canary"
}
rootProject.tasks.withType<KotlinNpmInstallTask>().configureEach {
args.add("--ignore-engines")
}