blob: 3cff5ca20d1529d78f973a27ca49846b2e9c9efb [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
Roman Elizarove1a56522018-04-04 10:31:08 +030013tasks.withType(compileKotlin2Js.getClass()) {
14 kotlinOptions {
15 moduleKind = "umd"
16 sourceMap = true
17 metaInfo = true
Roman Elizarov31452902018-04-11 13:58:19 +030018 }
19}
20
21compileKotlin2Js {
22 kotlinOptions {
Roman Elizarove1a56522018-04-04 10:31:08 +030023 // drop -js suffix from outputFile
24 def baseName = project.name - "-js"
25 outputFile = new File(outputFile.parent, baseName + ".js")
26 }
27}
28