When exporting a library as a package using `jsBro...
# javascript
f
When exporting a library as a package using
jsBrowserDevelopmentLibraryDistribution
, the generated sourceMaps contain relative paths to the original source files, e.g.
"sources":["../../../../../../../../domain/utility/src/commonMain/kotlin/com/example/Test.kt", ...
Once that the library is packaged in an npm package and shared, those source maps don't make any sense though, and debugging becomes impossible. Is there a way to include the source files in the output package? The alternative would be embedding the source in the source maps (
sourceMapEmbedSources
), but apparently it doesn't work with the IR backend: https://youtrack.jetbrains.com/issue/KT-49757/Kotlin-JS-support-sourceMapEmbedSources-setting-by-IR-backend
e
It does work with the IR backend, see https://youtrack.jetbrains.com/issue/KT-61318
Check the last comment.
f
That fixed it thank you color Not easy to find