phantasmal-world/web/build.gradle.kts

67 lines
2.2 KiB
Plaintext
Raw Normal View History

plugins {
id("world.phantasmal.js")
kotlin("plugin.serialization")
}
kotlin {
js {
browser {
commonWebpackConfig {
cssSupport.enabled = true
}
runTask {
devServer = devServer!!.copy(
open = false,
port = 1623,
)
}
}
binaries.executable()
}
}
val ktorVersion: String by project.extra
val serializationVersion: String by project.extra
dependencies {
implementation(project(":lib"))
implementation(project(":webui"))
implementation(project(":web:shared"))
implementation("io.ktor:ktor-client-core-js:$ktorVersion")
implementation("io.ktor:ktor-client-serialization-js:$ktorVersion")
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:$serializationVersion")
implementation("org.jetbrains.kotlinx:kotlinx-datetime:0.1.1")
2020-11-15 05:18:10 +08:00
implementation(npm("golden-layout", "^1.5.9"))
// Can't upgrade monaco-editor until https://github.com/microsoft/monaco-editor/issues/2466 is
// fixed.
2020-12-06 04:48:26 +08:00
implementation(npm("monaco-editor", "0.20.0"))
implementation(npm("three", "^0.128.0"))
implementation(npm("javascript-lp-solver", "0.4.17"))
2020-11-15 05:18:10 +08:00
implementation(devNpm("file-loader", "^6.2.0"))
// Can't upgrade monaco-editor-webpack-plugin until monaco-editor is upgraded.
implementation(devNpm("monaco-editor-webpack-plugin", "1.9.1"))
testImplementation(project(":test-utils"))
}
val copyAssemblyWorkerJsTask = tasks.register<Copy>("copyAssemblyWorkerJs") {
dependsOn(":web:assembly-worker:build")
val workerDist = project(":web:assembly-worker").buildDir.resolve("distributions")
from(workerDist.resolve("assembly-worker.js"), workerDist.resolve("assembly-worker.js.map"))
into(buildDir.resolve("processedResources/js/main"))
}
// TODO: Figure out how to make this work with --continuous.
2021-03-23 22:27:27 +08:00
tasks.getByName("processResources").dependsOn(copyAssemblyWorkerJsTask)
tasks.register<Copy>("generateAssets") {
dependsOn(":web:assets-generation:generateAssets")
from("assets-generation/build/generatedAssets")
into("src/main/resources/assets")
}