50 lines
1.6 KiB
Kotlin
50 lines
1.6 KiB
Kotlin
import org.jetbrains.compose.desktop.application.dsl.TargetFormat
|
|
import org.jetbrains.kotlin.gradle.ExperimentalWasmDsl
|
|
import org.jetbrains.kotlin.gradle.targets.js.webpack.KotlinWebpackConfig
|
|
|
|
plugins {
|
|
alias(libs.plugins.kotlinMultiplatform)
|
|
alias(libs.plugins.composeMultiplatform)
|
|
alias(libs.plugins.composeCompiler)
|
|
}
|
|
|
|
kotlin {
|
|
@OptIn(ExperimentalWasmDsl::class)
|
|
wasmJs {
|
|
moduleName = "composeApp"
|
|
browser {
|
|
val rootDirPath = project.rootDir.path
|
|
val projectDirPath = project.projectDir.path
|
|
commonWebpackConfig {
|
|
outputFileName = "composeApp.js"
|
|
devServer = (devServer ?: KotlinWebpackConfig.DevServer()).apply {
|
|
static = (static ?: mutableListOf()).apply {
|
|
// Serve sources to debug inside browser
|
|
add(rootDirPath)
|
|
add(projectDirPath)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
binaries.executable()
|
|
}
|
|
|
|
sourceSets {
|
|
|
|
commonMain.dependencies {
|
|
implementation(compose.runtime)
|
|
implementation(compose.foundation)
|
|
implementation(compose.material3)
|
|
implementation(compose.ui)
|
|
implementation(compose.components.resources)
|
|
implementation(compose.components.uiToolingPreview)
|
|
implementation(libs.androidx.lifecycle.viewmodel)
|
|
implementation(libs.androidx.lifecycle.runtime.compose)
|
|
implementation(libs.coil)
|
|
implementation(libs.coil.compose)
|
|
implementation(libs.coil.ktor)
|
|
}
|
|
}
|
|
}
|
|
|
|
|