File tree Expand file tree Collapse file tree
kotlin/net/kyori/adventure/webui/jvm/minimessage Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -177,10 +177,12 @@ tasks {
177177 named<AbstractCopyTask >(" jvmProcessResources" ) {
178178 duplicatesStrategy = DuplicatesStrategy .INCLUDE
179179
180- from(webpackTask.flatMap { it.mainOutputFile })
180+ from(webpackTask.flatMap { it.mainOutputFile }) {
181+ into(" web/js" )
182+ include(" *.js" , " *.js.map" )
183+ }
181184
182185 val configProperties = objects.mapProperty(String ::class , String ::class )
183- configProperties.put(" jsScriptFile" , " ${rootProject.name} .js" )
184186 configProperties.put(
185187 " miniMessageVersion" ,
186188 libs.adventure.minimessage.map { it.versionConstraint.requiredVersion },
Original file line number Diff line number Diff line change 1313 < meta name ="msapplication-TileColor " content ="#603cba ">
1414 < meta name ="theme-color " content ="#ffffff ">
1515 < title > MiniMessage Viewer | Edit MiniMessage easily online</ title >
16- <!--suppress HtmlUnknownTarget --> < script src ="js/main .js " defer > </ script >
16+ <!--suppress HtmlUnknownTarget --> < script src ="js/adventure-webui .js " defer > </ script >
1717 < link rel ="stylesheet " href ="https://cdn.jsdelivr.net/npm/bulma@0.9.3/css/bulma.min.css "
1818 integrity ="sha256-UDtbUHqpVVfXmdJcQVU/bfDEr9xldf3Dbd0ShD0Uf/Y= " crossorigin ="anonymous ">
1919 < link rel ="stylesheet " href ="https://cdn.jsdelivr.net/npm/bulma-prefers-dark@0.1.0-beta.1/css/bulma-prefers-dark.min.css "
Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ import io.ktor.server.http.content.defaultResource
66import io.ktor.server.http.content.resource
77import io.ktor.server.http.content.resources
88import io.ktor.server.http.content.static
9+ import io.ktor.server.http.content.staticFiles
910import io.ktor.server.http.content.staticResources
1011import io.ktor.server.request.receiveText
1112import io.ktor.server.response.respondText
@@ -55,6 +56,7 @@ import net.kyori.adventure.webui.websocket.Placeholders
5556import net.kyori.adventure.webui.websocket.Response
5657import java.time.Instant
5758import net.kyori.adventure.webui.jvm.minimessage.hook.SHADOW_COLOR_RENDER_HOOK
59+ import java.io.File
5860
5961private val startedAt = Instant .now()
6062
@@ -102,14 +104,7 @@ public fun Application.miniMessage() {
102104
103105 routing {
104106 // define static path to resources
105- static(" " ) {
106- resources(" web" )
107- defaultResource(" web/index.html" )
108-
109- val script = this @miniMessage.getConfigString(" jsScriptFile" )
110- resource(" js/main.js" , script)
111- resource(" js/$script .map" , " $script .map" )
112- }
107+ staticResources(" /" , " web" )
113108
114109 // set up other routing
115110 route(URL_API ) {
Original file line number Diff line number Diff line change 1111 }
1212
1313 config {
14- jsScriptFile = "$jsScriptFile"
1514 miniMessageVersion = "$miniMessageVersion"
1615 commitHash = "$commitHash"
1716 bytebinInstance = "https://bytebin.lucko.me"
You can’t perform that action at this time.
0 commit comments