Skip to content

Commit 5ec7dac

Browse files
author
Cody Koeninger
authored
Merge pull request #1 from twogood/build.gradle.kts
Convert Gradle script to build.gradle.kts
2 parents 99b8ce5 + 959c1f3 commit 5ec7dac

File tree

2 files changed

+27
-26
lines changed

2 files changed

+27
-26
lines changed

build.gradle

Lines changed: 0 additions & 26 deletions
This file was deleted.

build.gradle.kts

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
plugins {
2+
id("org.jetbrains.kotlin.js") version "1.3.72"
3+
}
4+
5+
group = "org.example"
6+
version = "1.0-SNAPSHOT"
7+
8+
repositories {
9+
mavenCentral()
10+
}
11+
12+
dependencies {
13+
implementation(kotlin("stdlib-js"))
14+
testImplementation(kotlin("test-js"))
15+
}
16+
17+
kotlin.target.browser {
18+
}
19+
20+
21+
tasks.register("buildWorker") {
22+
dependsOn("browserProductionWebpack")
23+
doLast {
24+
/* Kotlin js output assumes window exists, which it won't on Workers. Hack around it */
25+
file("$projectDir/index.js").writeText("const window=this; " + file("$projectDir/build/distributions/${rootProject.name}.js").readText())
26+
}
27+
}

0 commit comments

Comments
 (0)