blob: 71301f983ef7d419e43c912ac6936e2e30b35617 [file] [log] [blame]
Roman Elizarov1f74a2d2018-06-29 19:19:45 +03001/*
2 * Copyright 2016-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
3 */
Roman Elizarove1a56522018-04-04 10:31:08 +03004
5// Platform-specific configuration to compile JS modules
6
7apply plugin: 'kotlin-platform-js'
8
Roman Elizarov31452902018-04-11 13:58:19 +03009kotlin.experimental.coroutines "enable"
10
11dependencies {
12 compile "org.jetbrains.kotlin:kotlin-stdlib-js:$kotlin_version"
13 testCompile "org.jetbrains.kotlin:kotlin-test-js:$kotlin_version"
14}
15
Roman Elizarove1a56522018-04-04 10:31:08 +030016tasks.withType(compileKotlin2Js.getClass()) {
17 kotlinOptions {
18 moduleKind = "umd"
19 sourceMap = true
20 metaInfo = true
Roman Elizarov31452902018-04-11 13:58:19 +030021 }
22}
23
24compileKotlin2Js {
25 kotlinOptions {
Roman Elizarove1a56522018-04-04 10:31:08 +030026 // drop -js suffix from outputFile
27 def baseName = project.name - "-js"
28 outputFile = new File(outputFile.parent, baseName + ".js")
29 }
30}
31