robnik
02/25/2022, 10:18 PMstatic("/static") { resources() }
, which serves the compiled JS. Problem is: it serves all resources! Insecure, no? How do I change the gradle file to copy the compiled JS into a subdir? (More in thread)resources("web")
and it will only serve resources starting with "web/". But Gradle is opaque to me, and I don't know how to change it to put the JS output there. Maybe there is another way to filter what resources(...)
will serve up. I don't want to expose things like application.conf
.Aleksei Tirman [JB]
02/27/2022, 9:22 AMweb
package inside the JAR you can replace the line from(File(webpackTask.destinationDirectory, webpackTask.outputFileName))
in the build.gradle.kts
file with the following lines:
into("web") {
from(File(webpackTask.destinationDirectory, webpackTask.outputFileName))
}
robnik
02/27/2022, 3:21 PMbuild.gradle.kts
. After the kotlin { ... }
block, there are only two "tasks":
tasks.named<Copy>("jvmProcessResources") {
val jsBrowserDistribution = tasks.named("jsBrowserDistribution")
from(jsBrowserDistribution)
}
tasks.named<JavaExec>("run") {
dependsOn(tasks.named<Jar>("jvmJar"))
classpath(tasks.named<Jar>("jvmJar"))
}
Aleksei Tirman [JB]
02/28/2022, 7:05 AMfrom(jsBrowserDistribution)
with the following lines:
into("web") {
from(jsBrowserDistribution)
}