mirror of
https://github.com/gotson/komga.git
synced 2026-05-08 12:35:30 +02:00
build: prepare to serve next-ui dist
This commit is contained in:
parent
75393bb3e3
commit
c78b47c162
2 changed files with 14 additions and 1 deletions
|
|
@ -143,6 +143,7 @@ kotlin {
|
|||
}
|
||||
|
||||
val webui = "$rootDir/komga-webui"
|
||||
val nextui = "$rootDir/next-ui"
|
||||
tasks {
|
||||
withType<JavaCompile> {
|
||||
sourceCompatibility = "17"
|
||||
|
|
@ -218,6 +219,18 @@ tasks {
|
|||
}
|
||||
}
|
||||
|
||||
// modifies index.html to inject ThymeLeaf th: tags
|
||||
register<Copy>("prepareThymeLeafNext") {
|
||||
group = "web"
|
||||
from("$nextui/dist/index.html")
|
||||
into("$projectDir/src/main/resources/public/")
|
||||
filter { line ->
|
||||
line.replace("((?:src|content|href)=\")([\\w]*/.*?)(\")".toRegex()) {
|
||||
it.groups[0]?.value + " th:" + it.groups[1]?.value + "@{" + it.groups[2]?.value?.prefixIfNot("/") + "}" + it.groups[3]?.value
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
withType<ProcessResources> {
|
||||
filesMatching("application*.yml") {
|
||||
expand(project.properties)
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ class WebMvcConfiguration : WebMvcConfigurer {
|
|||
).addResourceLocations("classpath:public/")
|
||||
.setCacheControl(CacheControl.noStore())
|
||||
|
||||
listOf("css", "fonts", "img", "js")
|
||||
listOf("css", "fonts", "img", "js", "assets")
|
||||
.forEach {
|
||||
registry
|
||||
.addResourceHandler("/$it/**")
|
||||
|
|
|
|||
Loading…
Reference in a new issue