internal change
PiperOrigin-RevId: 223970795
diff --git a/internal/common/tsconfig.bzl b/internal/common/tsconfig.bzl
index 971bd83..7bf1f2d 100644
--- a/internal/common/tsconfig.bzl
+++ b/internal/common/tsconfig.bzl
@@ -69,6 +69,10 @@
if p
])
workspace_path = "/".join([".."] * len(tsconfig_dir.split("/")))
+
+ # Sourcemaps should be relative to workspace_root. Reuse the tsconfig_dir, but take out the bin_dir.
+ sourcemap_root = "/".join([".."] * (len(tsconfig_dir.split("/")) - len(ctx.bin_dir.path.split("/"))))
+
if module_path_prefixes == None:
module_path_prefixes = [
"",
@@ -251,6 +255,7 @@
# Embed source maps and sources in .js outputs
"inlineSourceMap": True,
"inlineSources": True,
+ "sourceRoot": sourcemap_root,
# Implied by inlineSourceMap: True
"sourceMap": False,
}