Username404-Website/build.gradle.kts

66 lines
1.7 KiB
Plaintext
Raw Normal View History

2021-06-20 13:27:01 +02:00
plugins {
id("org.jetbrains.kotlin.js") version "1.5.20-RC"
}
group = "fr.username404"
version = "0.1"
repositories {
mavenCentral()
}
dependencies {
implementation(kotlin("stdlib-js"))
implementation("org.jetbrains.kotlinx:kotlinx-html:0.7.3")
}
val outputDirectory = file("$rootDir/compiledOutput")
2021-06-20 13:27:01 +02:00
kotlin {
js(IR) {
moduleName = "Username404_Website"
2021-06-20 15:20:32 +02:00
compilations.all {
with(languageSettings) {
apiVersion = coreLibrariesVersion.substring(0..2)
languageVersion = (apiVersion!!.toDouble() + 0.1).toString()
progressiveMode = true
}
2021-06-20 15:20:32 +02:00
with(kotlinOptions) {
2021-06-20 15:42:32 +02:00
moduleKind = "plain"
2021-06-20 15:20:32 +02:00
freeCompilerArgs = freeCompilerArgs + listOf(
"-Xopt-in=kotlin.RequiresOptIn",
2021-06-20 15:34:54 +02:00
"-Xopt-in=kotlin.js.ExperimentalJsExport",
"-Xir-property-lazy-initialization"
2021-06-20 15:20:32 +02:00
)
}
}
2021-06-20 13:27:01 +02:00
browser {
webpackTask {
destinationDirectory = outputDirectory
2021-06-20 16:20:53 +02:00
output.library = "Web404"
output.libraryTarget = "this"
2021-06-20 13:27:01 +02:00
cssSupport.enabled = true
}
runTask {
cssSupport.enabled = true
}
testTask {
useKarma {
useFirefoxNightlyHeadless()
webpackConfig.cssSupport.enabled = true
}
}
}
binaries.executable()
}
}
tasks {
clean.get().delete.add(outputDirectory)
withType(ProcessResources::class) {
destinationDir = outputDirectory
}
}