Chilli
08/08/2021, 4:25 PMbuild.gradle.kts
:
plugins {
kotlin("multiplatform") version "1.5.10"
}
group = "me.chilli"
version = "1.0"
repositories {
mavenCentral()
}
kotlin {
// ... [JVM config here]
js(IR) {
browser {
webpackTask {
sourceMaps = true
}
commonWebpackConfig {
cssSupport.enabled = true
}
}
}
// ...
sourceSets {
// ...
val jsMain by getting
// ...
}
}
And then trying to run it using gradlew browserDevelopmentRun
but it gives me:
FAILURE: Build failed with an exception.
* What went wrong:
Task 'browserDevelopmentRun' not found in root project '...'.
turansky
08/08/2021, 4:58 PMturansky
08/08/2021, 4:58 PMturansky
08/08/2021, 4:59 PMBrowser
Chilli
08/08/2021, 8:00 PMturansky
08/08/2021, 8:11 PMbinaries.executable()
(if IR compiler used)Chilli
08/08/2021, 10:45 PMindex.html
file, but how do I run code with that? Can't see any Kotlin inside the /build/processedResources
directory, but I guess I gotta include it in the HTML file somehow?turansky
08/08/2021, 10:50 PMChilli
08/08/2021, 10:50 PMChilli
08/08/2021, 10:51 PM/src/jsMain
I have a kotlin
directory with a main.kt
file, and a resources
directory with an index.html
file. The browser sees the index.html file, but I have no idea how to make main.kt
run on the frontendChilli
08/08/2021, 10:53 PMturansky
08/08/2021, 10:53 PMturansky
08/08/2021, 10:55 PMPROJECT_ROOT/build/js/packages/...
Chilli
08/08/2021, 10:56 PMChilli
08/08/2021, 10:57 PMturansky
08/08/2021, 10:59 PMOh, so the JS file name is just the project nameUse
moduleName
to configure file nameturansky
08/08/2021, 10:59 PMturansky
08/08/2021, 11:01 PMJS file name is just the project nameIt’s true only for root project
Chilli
08/08/2021, 11:08 PMChilli
08/08/2021, 11:23 PMturansky
08/08/2021, 11:29 PMChilli
08/09/2021, 7:05 AMbrowserDevelopmentRun
faster to refresh when editing the HTML/CSS resource files? On every change I have to re-run it, it compiles, and then it opens a new tab for me instead of using the previous oneandylamax
08/09/2021, 8:11 AMbrowserDevelopmentRun -t
CLOVIS
08/09/2021, 8:11 AMandylamax
08/09/2021, 8:12 AMCLOVIS
08/09/2021, 8:12 AMChilli
08/09/2021, 9:08 AM