blob: 59c47d24ea1c53eaac388716a63c848f8e3ee365 [file] [log] [blame]
Roman Elizarove1a56522018-04-04 10:31:08 +03001
2// Platform-specific configuration to compile JS modules
3
4apply plugin: 'kotlin-platform-js'
5
Roman Elizarov31452902018-04-11 13:58:19 +03006kotlin.experimental.coroutines "enable"
7
8dependencies {
9 compile "org.jetbrains.kotlin:kotlin-stdlib-js:$kotlin_version"
10 testCompile "org.jetbrains.kotlin:kotlin-test-js:$kotlin_version"
11}
12
13repositories {
14 jcenter()
15 maven { url "https://kotlin.bintray.com/kotlinx" }
16}
17
Roman Elizarove1a56522018-04-04 10:31:08 +030018tasks.withType(compileKotlin2Js.getClass()) {
19 kotlinOptions {
20 moduleKind = "umd"
21 sourceMap = true
22 metaInfo = true
Roman Elizarov31452902018-04-11 13:58:19 +030023 }
24}
25
26compileKotlin2Js {
27 kotlinOptions {
Roman Elizarove1a56522018-04-04 10:31:08 +030028 // drop -js suffix from outputFile
29 def baseName = project.name - "-js"
30 outputFile = new File(outputFile.parent, baseName + ".js")
31 }
32}
33