Your generated js file is named after your module....
# javascript
t
Your generated js file is named after your module. You can have a look in
build/distributions
after running
./gradlew jsBrowserWebpack
to see the result Additionally, you can add a
index.html
with a
<script src="<my-module>.js"></script>
to your
jsMain/resources
folder and it will be copied to your build folder and used when you run
./gradlew jsBrowserRun
👍 1
s
Thanks it works with
./gradlew browserWebpack
I hope documentation will be updated, that's a pretty painful journey for now.
Do you know how I can customize
moduleKind
?
t
My advice would be to move your
build.gradle
to Kotlin, that way you’ll have autocompletion and can explore the plugin code more easily
s
It is already with Kotlin DSL
But not obvious given all the changes, multiplatform versus regular plugin, etc.
t
Copy code
configure<KotlinMultiplatformExtension> {
    js {
        compilations.all {
            compileKotlinTask.kotlinOptions {
                moduleKind = "commonjs"
                sourceMap = true
                sourceMapEmbedSources = "always"
            }
        }
        browser {
            webpackTask {

            }
        }
    }
You also have the
useCommonJs()
helper if you just want to use CommonJs
s
Ok thanks
Yes I use it