We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 99b8ce5 + 959c1f3 commit 5ec7dacCopy full SHA for 5ec7dac
build.gradle
build.gradle.kts
@@ -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