summaryrefslogtreecommitdiff
path: root/build.gradle.kts
diff options
context:
space:
mode:
Diffstat (limited to 'build.gradle.kts')
-rw-r--r--build.gradle.kts31
1 files changed, 18 insertions, 13 deletions
diff --git a/build.gradle.kts b/build.gradle.kts
index 99c6139..c657335 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -1,5 +1,5 @@
plugins {
- kotlin("multiplatform") version "1.5.21"
+ kotlin("js") version "1.5.21"
id("io.kotest.multiplatform") version "5.0.0.3"
id("com.bnorm.power.kotlin-power-assert") version "0.10.0"
}
@@ -14,24 +14,19 @@ val kotestVersion: String by project
configure<com.bnorm.power.PowerAssertGradleExtension> {
functions = listOf("kotlin.assert", "kotlin.test.assertTrue", "kotlin.test.assertFalse", "kotlin.test.assertEquals")
}
-
kotlin {
- targets {
- js(IR) {
- nodejs { }
- browser {
- webpackTask {
- output.libraryTarget = "umd"
- }
- testTask { useMocha() }
- }
+ js(IR) {
+ binaries.executable()
+ useCommonJs()
+ browser {
+ testTask { useMocha() }
}
}
sourceSets {
- val jsMain by getting {
+ val main by getting {
}
- val jsTest by getting {
+ val test by getting {
dependencies {
implementation("io.kotest:kotest-assertions-core:5.0.0.376-SNAPSHOT")
implementation("io.kotest:kotest-framework-api:5.0.0.376-SNAPSHOT")
@@ -40,3 +35,13 @@ kotlin {
}
}
}
+
+tasks.withType<org.jetbrains.kotlin.gradle.tasks.Kotlin2JsCompile>() {
+ kotlinOptions {
+ moduleKind = "commonjs"
+ sourceMap = true
+ sourceMapEmbedSources = "always"
+ freeCompilerArgs += "-Xopt-in=kotlin.contracts.ExperimentalContracts"
+
+ }
+}