-
Notifications
You must be signed in to change notification settings - Fork 1.9k
/
Copy pathbuild.gradle
54 lines (50 loc) · 1.57 KB
/
build.gradle
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
/*
* Copyright 2016-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
*/
project.kotlin {
js(LEGACY) {
binaries.executable()
browser {
distribution {
directory = new File(directory.parentFile, "dist")
}
webpackTask {
cssSupport.enabled = true
}
runTask {
cssSupport.enabled = true
}
testTask {
useKarma {
useChromeHeadless()
webpackConfig.cssSupport.enabled = true
}
}
}
}
sourceSets {
main.dependencies {
implementation "org.jetbrains.kotlinx:kotlinx-html-js:$html_version"
implementation(npm("html-webpack-plugin", "3.2.0"))
}
}
}
// Workaround for bug in 1.4.20 that will be fixed in 1.4.21, KT-43668
tasks.withType(org.jetbrains.kotlin.gradle.targets.js.npm.tasks.KotlinPackageJsonTask) {
doFirst {
def producerField = it.class.superclass.getDeclaredMethod("getProducer")
producerField.setAccessible(true);
def producer = producerField.invoke(it)
def items = producer.fileCollectionDependencies
def list2 = new HashSet<FileCollectionDependency>()
for (FileCollectionDependency item : items) {
for (File file : item.files) {
if (!file.isFile()) {
list2.add(item)
break
}
}
}
items.removeAll(list2)
}
}