Kotlin MPP webpack sourcemap issue on included dependencies

When I have an MPP project with a js target that I make as a library and consume it in another KotlinJs
or MPP project, I’d like to be able to debug into that libraries source with the sourcemap. Right now, it appears that I’m able to access the source of my current project via webpack within the browser, but none of the source from a dependency.

For example, let’s say I have a project with this:

Main.kt

fun main() {
     throw RuntimeException("blah")
}

the browser generates this correctly with this in the console


And the kicker is that clicking on the Main.kt link, it loads my source file properly, and I can put breakpoints in it perfectly.
image

now if I’ve got a library project with a js target that I pull in from maven that has a function like so

Bootstrap.Kt

package github.fatalcatharsis

fun test() {
      throw RuntimeException("blah2")
}

and change
Main.kt

import github.fatalcatharsis.test

fun main() {
    test()
}

the browser still interprets the source map correctly


But cannot load the source.

Has anyone dealt with this? I assume it’s either that the sources in my “-sources” variant aren’t being pulled in and made available to webpack or that they are but webpack just isn’t being configured to look at them properly.

I haven’t found a way to resolve those files in the browser, but I did find something even better for my specific situation. Since I made the library I’m consuming, I included the project as another module in the same workspace in intellij.
image
Then, when I run jsBrowserDevelopmentRun and then setup a debug/run configuration for “Javascript Debugging” with chrome selected, setting the port to 8080 (the port that the jsBrowserDevelopmentRun task runs the little nodejs server on), all the breakpoints I put in intellij including those in the other module are hit when the debug instance of chrome opens.