summaryrefslogtreecommitdiff
path: root/sw-ui/build.gradle.kts
blob: 2efb54abb00dc4a5487c00c4dbb01b8589c712b0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
import org.jetbrains.kotlin.gradle.targets.js.webpack.KotlinWebpack

plugins {
    kotlin("multiplatform")
}

kotlin {
    js {
        binaries.executable()
        browser()
        useCommonJs()
    }
    sourceSets {
        val jsMain by getting {
            dependencies {
                implementation(projects.swClient)

                implementation(libs.kotlinx.coroutines.core)

                implementation(platform(libs.kotlin.wrappers.bom.get()))
                implementation(libs.kotlin.wrappers.react.base)
                implementation(libs.kotlin.wrappers.react.dom)
                implementation(libs.kotlin.wrappers.react.redux)
                implementation(libs.kotlin.wrappers.react.router.dom)
                implementation(libs.kotlin.wrappers.blueprintjs.core)
                implementation(libs.kotlin.wrappers.blueprintjs.icons)
                implementation(libs.kotlin.wrappers.emotion)
            }
        }
        val jsTest by getting {
            dependencies {
                implementation(kotlin("test-js"))
                implementation(libs.kotlinx.coroutines.test)
            }
        }
    }
}

tasks.named<ProcessResources>("jsProcessResources") {
    val webpack = project.tasks.withType(KotlinWebpack::class).first()

    val bundleFile = webpack.outputFileName
    val publicPath = "./" // TODO get public path from webpack config

    filesMatching("*.html") {
        expand("bundle" to bundleFile, "publicPath" to publicPath)
    }
}
bgstack15