Piotr Krzemiński
11/18/2022, 12:47 PMbuild/distributions
, and another module with a working ktor server. What’s the idiomatic way to declare a dependency on the web UI project form the ktor project, copy over the bundle to the ktor module and serve it from ktor? My ultimate goal is being able to create a Docker image with the server hosting the web UI, so I presume the bundle should land somewhere in JVM resources
Piotr Krzemiński
11/18/2022, 1:02 PMsourceSets {
main {
resources {
setSrcDirs(listOf("${project.buildDir}/js-bundle"))
}
}
}
tasks.processResources {
dependsOn(copyJsBundleToResources)
}
val copyJsBundleToResources by tasks.registering(Copy::class) {
dependsOn(":web-ui:build")
from("$rootDir/web-ui/build/distributions")
into("${project.buildDir}/js-bundle")
}
• Main.kt:
routing {
singlePageApplication {
useResources = true
}
}
Piotr Krzemiński
11/18/2022, 1:10 PMreact(…)
inside singlePageApplication
gives over the above. It’s defined as:
public fun SPAConfig.react(filesPath: String) {
this.filesPath = filesPath
}
is it only for the sake of documentation?Big Chungus
11/18/2022, 2:13 PMPiotr Krzemiński
11/18/2022, 2:23 PMBig Chungus
11/18/2022, 2:24 PMBig Chungus
11/18/2022, 2:24 PMBig Chungus
11/18/2022, 2:26 PMBig Chungus
11/18/2022, 2:27 PMPiotr Krzemiński
11/18/2022, 2:33 PMBig Chungus
11/18/2022, 2:35 PMBig Chungus
11/18/2022, 2:35 PMBig Chungus
11/18/2022, 2:36 PMPiotr Krzemiński
11/18/2022, 2:36 PMCLOVIS
11/19/2022, 1:31 PMCLOVIS
11/19/2022, 1:32 PMPiotr Krzemiński
11/19/2022, 2:02 PMCLOVIS
11/19/2022, 2:10 PMCLOVIS
11/19/2022, 2:10 PM