This repository was archived by the owner on Feb 20, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild.gradle.kts
59 lines (52 loc) · 1.85 KB
/
build.gradle.kts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
@file:Suppress("UnstableApiUsage")
import org.jetbrains.kotlin.gradle.targets.js.webpack.KotlinWebpackConfig
group = "org.patternfly"
version = "0.1.0"
// https://youtrack.jetbrains.com/issue/KTIJ-19369#focus=Comments-27-5181027.0-0
@Suppress("DSL_SCOPE_VIOLATION")
plugins {
alias(libs.plugins.js)
alias(libs.plugins.serialization)
}
val repositories = arrayOf(
"https://oss.sonatype.org/content/repositories/snapshots/",
"https://s01.oss.sonatype.org/content/repositories/snapshots/"
)
repositories {
mavenLocal()
mavenCentral()
repositories.forEach { maven(it) }
}
dependencies {
implementation(libs.bundles.pfk)
implementation(libs.serialization.json)
implementation(npm("@github/time-elements", libs.versions.timeElements.get()))
implementation(npm("@patternfly/patternfly", libs.versions.patternFly.get()))
implementation(npm("clipboard", libs.versions.clipboard.get()))
implementation(npm("highlight.js", libs.versions.highlight.get()))
implementation(devNpm("css-loader", libs.versions.cssLoader.get()))
implementation(devNpm("sass", libs.versions.sass.get()))
implementation(devNpm("sass-loader", libs.versions.sassLoader.get()))
implementation(devNpm("style-loader", libs.versions.styleLoader.get()))
}
val webDir = file("src/main/web")
kotlin {
js {
browser {
runTask {
outputFileName = "main.bundle.js"
sourceMaps = true
devServer = KotlinWebpackConfig.DevServer(
open = true,
port = 3000,
static = mutableListOf("$buildDir/processedResources/js/main")
)
}
webpackTask {
outputFileName = "main.bundle.js"
}
}
binaries.executable()
}
sourceSets["main"].resources.srcDir(webDir)
}