How to debug multi-executable JS applications

I’m currently writing an application which compiles to Javascript. When testing, I’m using the jsBrowserDevelopmentRun Gradle task which allows me to easily test my code.

I have now added a second js task in build.gradle in order to accommodate a separate executable that is loaded as a webworker. I’m basing my solution on this: GitHub - ethanmdavidson/KotlinJSWebWorkerDemo: A simple demo that shows how WebWorkers can be used in Kotlin/JS

My problem is that the code in the main application (client.js in the example code) cannot find the webworker code (worker.js), because this file is not served by the dev server. I would have to start a second dev server to serve worker.js and adjust the URL’s to match. This is very annoying.

Is there a better solution? I would like to have my dev server serve all the files in the distribution directory.