-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy pathbuild.gradle
66 lines (57 loc) · 1.77 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
55
56
57
58
59
60
61
62
63
64
65
66
plugins {
id "kotlin2js" version "1.3.21"
id "org.jetbrains.kotlin.frontend" version "0.0.45"
id "kotlin-dce-js" version "1.3.21"
}
group 'kotlin-poc-frontend-react-redux'
version '1.0-SNAPSHOT'
ext {
web_dir = "web"
}
repositories {
mavenCentral()
jcenter()
maven { url "https://kotlin.bintray.com/kotlin-js-wrappers" }
maven { url "https://kotlin.bintray.com/kotlinx" }
}
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-js"
implementation 'org.jetbrains:kotlin-react:16.6.0-pre.70-kotlin-1.3.21'
implementation 'org.jetbrains:kotlin-react-dom:16.6.0-pre.70-kotlin-1.3.21'
implementation 'org.jetbrains:kotlin-react-redux:5.0.7-pre.70-kotlin-1.3.21'
implementation 'org.jetbrains:kotlin-redux:4.0.0-pre.70-kotlin-1.3.21'
implementation 'org.jetbrains:kotlin-styled:1.0.0-pre.70-kotlin-1.3.21'
implementation 'org.jetbrains:kotlin-react-router-dom:4.3.1-pre.70-kotlin-1.3.21'
}
clean.doFirst() {
delete("${web_dir}")
}
bundle.doLast() {
copy {
from "${buildDir}/resources/main/web"
from "${buildDir}/bundle"
into "${web_dir}"
}
}
kotlinFrontend {
npm {
dependency "react"
dependency "react-dom"
dependency "react-router-dom"
dependency "react-redux"
dependency "redux"
dependency "core-js"
dependency "inline-style-prefixer"
dependency "styled-components"
}
webpackBundle {
bundleName = "this-will-be-overwritten" // NOTE: for example purposes this is overwritten in `webpack.config.d/filename.js`.
contentPath = file('src/main/resources/web')
if (project.hasProperty('prod')) {
mode = "production"
}
}
}
compileKotlin2Js {
kotlinOptions.moduleKind = 'commonjs'
}