Is it possible to get sourcemaps to use absolute p...
# javascript
a
Is it possible to get sourcemaps to use absolute paths instead of relative paths? When developing locally, we use
yarn link
a lot, and end up with mismatches between the generated sourcemap's relative path and where the code actually is. This can be annoying because it breaks in-browser debugging. Things would be easier for us if we could just use absolute paths instead. I've tried setting
Copy code
freeCompilerArgs += listOf(
            "-source-map-base-dirs", "/",
            "-source-map-prefix", "/"
        )
but that doesn't seem to work.
Update: When I drop the
"-source-map-prefix", "/"
, the
-source-map-base-dirs
seems to work: I get paths relative to my root! But those are still relative paths: they're missing the
/
prefix Using
KotlinJsOptions.sourceMapPrefix
instead of the freeCompilerArgs doesn't seem to work either.
If I set
sourceMapPrefix
to something like
"fooBar"
or `"fooBar/"``, it works just fine, even alongside source-map-prefix. It's just
"/"
that's being ignored.