55 lines
1.5 KiB
Plaintext
55 lines
1.5 KiB
Plaintext
import org.jetbrains.kotlin.gradle.targets.js.dsl.ExperimentalWasmDsl
|
|
import org.jetbrains.kotlin.gradle.targets.js.webpack.KotlinWebpackConfig
|
|
|
|
plugins {
|
|
alias(libs.plugins.kotlinMultiplatform)
|
|
alias(libs.plugins.kotlinSerialization)
|
|
}
|
|
|
|
kotlin {
|
|
jvm()
|
|
|
|
@OptIn(ExperimentalWasmDsl::class)
|
|
wasmJs {
|
|
browser {
|
|
val rootDirPath = project.rootDir.path
|
|
val projectDirPath = project.projectDir.path
|
|
commonWebpackConfig {
|
|
devServer = (devServer ?: KotlinWebpackConfig.DevServer()).apply {
|
|
static = (static ?: mutableListOf()).apply {
|
|
// Serve sources to debug inside browser
|
|
add(rootDirPath)
|
|
add(projectDirPath)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
sourceSets {
|
|
val commonMain by getting {
|
|
dependencies {
|
|
// Multiplatform dependencies
|
|
implementation(libs.kotlinx.serialization.json)
|
|
implementation(libs.kotlinx.datetime)
|
|
implementation(libs.uuid)
|
|
implementation(libs.bignum)
|
|
}
|
|
}
|
|
|
|
val commonTest by getting {
|
|
dependencies {
|
|
implementation(kotlin("test"))
|
|
}
|
|
}
|
|
|
|
// val jvmMain by getting {
|
|
// dependsOn(commonMain)
|
|
// }
|
|
//
|
|
// val wasmJsMain by getting {
|
|
// dependsOn(commonMain)
|
|
// }
|
|
}
|
|
}
|