Skip to content

Commit 513fb07

Browse files
authored
build: fix source maps in dev-app due to missing source contents (#23925)
1 parent 7746bef commit 513fb07

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

integration/size-test/index.bzl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ def size_test(name, file, deps):
5353
# Link the workspace root so that files can be loaded from the workspace.
5454
link_workspace_root = True,
5555
sourcemap = "external",
56+
sources_content = True,
5657
)
5758

5859
terser_minified(

tools/esbuild/index.bzl

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,18 @@ load("//tools/esbuild:devmode-output.bzl", "extract_devmode_output_with_mappings
55
# Re-export of the actual esbuild definitions.
66
esbuild_config = _esbuild_config
77

8-
def esbuild(name, deps = [], mapping_targets = [], testonly = False, **kwargs):
8+
def esbuild(
9+
name,
10+
deps = [],
11+
mapping_targets = [],
12+
testonly = False,
13+
# Inline source contents to make debugging easier. Contents are inlined by default
14+
# in ESBuild but `@bazel/esbuild` sets the default to `false`. Inlining sources is
15+
# helpful as otherwise developers would need to manually wire up the Bazel execroot
16+
# as workspace in the Chrome devtools.
17+
# https://github.com/bazelbuild/rules_nodejs/blob/c30a26c13d20dac48dc9f220370cb02a317b13f3/packages/esbuild/esbuild.bzl#L333.
18+
sources_content = True,
19+
**kwargs):
920
# Extract all JS module sources before passing to ESBuild. The ESBuild rule requests
1021
# both the devmode and prodmode unfortunately and this would slow-down the development
1122
# turnaround significantly. We only request the devmode sources which are ESM as well.
@@ -14,6 +25,7 @@ def esbuild(name, deps = [], mapping_targets = [], testonly = False, **kwargs):
1425
_esbuild(
1526
name = name,
1627
deps = devmode_targets,
28+
sources_content = sources_content,
1729
testonly = testonly,
1830
**kwargs
1931
)

0 commit comments

Comments
 (0)