Kotlin JS + React, unstable building

I think I fixed it!
I found Kotlin JS incremental compilation, but when I tried to copy the solution in a webpack.config.d/webpack.config.js in the project root, the server wouldn’t start at all (I assume because the devServer settings would be overwritten). So I copied the config.devServer settings from the auto-generated webpack.config.js, added the watchOptions, like this:

config.devServer = {
    "inline": true,
    "lazy": false,
    "noInfo": true,
    "open": true,
    "overlay": false,
    "port": 8080,
    "watchOptions": {
        "aggregateTimeout": 5000,
        "poll": 1000
    "contentBase": [
        "<PATH TO PROJECT>/build/processedResources/Js/main"

and now hot reloading works!
Let me say that this is quite a hacky solution, so if anyone knows how to add the watchOptions part using gradle, let me know!