dima.avdeev
1 year ago
10 changed files with 59 additions and 16 deletions
@ -0,0 +1,36 @@
|
||||
plugins { |
||||
kotlin("multiplatform") |
||||
id("org.jetbrains.compose") |
||||
} |
||||
|
||||
val copyResources = tasks.create("copyJsResourcesWorkaround", Copy::class.java) { |
||||
from(project(":resources:demo:shared").file("src/commonMain/resources")) |
||||
to("build/processedResources/js/main") |
||||
} |
||||
|
||||
kotlin { |
||||
js(IR) { |
||||
browser { |
||||
this.commonWebpackConfig { |
||||
println("this.outputPath: ${this.outputPath}") |
||||
this.devServer?.contentBase |
||||
} |
||||
this.webpackTask { |
||||
this.dependsOn(copyResources) |
||||
} |
||||
} |
||||
binaries.executable() |
||||
} |
||||
sourceSets { |
||||
val jsMain by getting { |
||||
dependencies { |
||||
implementation(project(":resources:demo:shared")) |
||||
} |
||||
resources.srcDirs += project(":resources:demo:shared").file("src/commonMain/resources") |
||||
} |
||||
} |
||||
} |
||||
|
||||
compose.experimental { |
||||
web.application {} |
||||
} |
@ -0,0 +1,15 @@
|
||||
/* |
||||
* Copyright 2020-2023 JetBrains s.r.o. and respective authors and developers. |
||||
* Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE.txt file. |
||||
*/ |
||||
|
||||
import androidx.compose.ui.window.Window |
||||
import org.jetbrains.skiko.wasm.onWasmReady |
||||
|
||||
fun main() { |
||||
onWasmReady { |
||||
Window("Resources demo") { |
||||
MainView() |
||||
} |
||||
} |
||||
} |
After Width: | Height: | Size: 31 KiB |
After Width: | Height: | Size: 10 KiB |
Loading…
Reference in new issue