Kotlin/JS --continuous development speed

I am trying a new project with Kotlin Multiplatform with a JS target and test using:
gradlew jsBrowserRun --continuous however it takes approximately 10 seconds for it to show any difference.

After save it takes about 8 seconds for anything to be detected, after which it takes approx 2 seconds for a recompile of a very basic project.

Is there a way to speed this up? Front-end development is much easier if there is a more immediate feedback present.

See https://youtrack.jetbrains.com/issue/KT-39377#focus=Comments-27-4352292.0-0

Try adding webpack.config.d/webpack.js with:

if (config.devServer) {
    config.devtool = 'eval-cheap-source-map';
}

and change build.gradle.kts with:

kotlin {
    js {
        browser {
            runTask {
                // ...
                sourceMaps = false
            }
        }
    }
}

It speeds up the development cycle form me a lot.

1 Like

Yeah, that does a lot indeed. Thanks. Still it takes a long time for a change to trigger though. A far cry from normal frontend development.

Am I correct that I need to place the webpack.config.d dir in the root of my multiplatform project? So not in the resources dir of the JS target?

Yes, that’s correct.