aboutsummaryrefslogtreecommitdiff
path: root/gradle/compile-js.gradle
blob: 55c81fe56e7061f75772d3466e7126a623bbde30 (plain)
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
/*
 * Copyright 2016-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
 */

// Platform-specific configuration to compile JS modules

apply plugin: 'org.jetbrains.kotlin.js'

dependencies {
    testImplementation "org.jetbrains.kotlin:kotlin-test-js:$kotlin_version"
}

kotlin {
    js(LEGACY) {
        moduleName = project.name - "-js"
    }

    sourceSets {
        main.kotlin.srcDirs = ['src']
        test.kotlin.srcDirs = ['test']
        main.resources.srcDirs = ['resources']
        test.resources.srcDirs = ['test-resources']
    }
}

tasks.withType(compileKotlinJs.getClass()) {
    kotlinOptions {
        moduleKind = "umd"
        sourceMap = true
        metaInfo = true
    }
}