https://kotlinlang.org logo
#javascript
Title
# javascript
f

franztesca

12/08/2023, 7:26 PM
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

Edoardo Luppi

12/10/2023, 12:07 PM
It does work with the IR backend, see https://youtrack.jetbrains.com/issue/KT-61318
Check the last comment.
f

franztesca

12/11/2023, 1:49 AM
That fixed it thank you color Not easy to find