| buildscript { |
| repositories { |
| mavenLocal() |
| mavenCentral() |
| } |
| dependencies { |
| classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" |
| } |
| } |
| |
| apply plugin: 'kotlin-multiplatform' |
| |
| repositories { |
| mavenLocal() |
| mavenCentral() |
| } |
| |
| kotlin.targets.fromPreset(kotlin.presets.js, 'nodeJs') |
| |
| dependencies { |
| nodeJsMainApi "org.jetbrains.kotlin:kotlin-stdlib-js:$kotlin_version" |
| } |
| |
| compileKotlinNodeJs.kotlinOptions.outputFile = "${buildDir}/examplelib.js" |
| compileKotlinNodeJs.kotlinOptions.sourceMap = true |
| |
| nodeJsJar { |
| from buildDir |
| include "**/*.js" |
| include "**/*.js.map" |
| } |
| |
| nodeJsJar.dependsOn(compileKotlinNodeJs) |