Skip to content

Commit 7e7ea75

Browse files
clydinalan-agius4
authored andcommitted
build: disable inline sourcemap generation
The built packages that will be published on npm previously contained inlined sourcemaps for every JavaScript file. This caused a significant increase in the overall package size of over two times larger. This has a negative effect on developer experience especially the new project experience due to the increase time to download and setup a new project. The sourcemaps are also rarely used as debugging the CLI code itself is typically done with development builds. The generated code is also very close to the original source due to it being emitted as ES2022 code and with the eventual switch to ESM output this will become even closer. As an example of the size difference, the `@angular/cli` compressed package size was reduced from ~352Kb to ~115Kb with this change. (cherry picked from commit f7130ef)
1 parent 122802f commit 7e7ea75

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

tools/postinstall/patches/@bazel+concatjs+5.8.1.patch

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
diff --git a/node_modules/@bazel/concatjs/internal/build_defs.bzl b/node_modules/@bazel/concatjs/internal/build_defs.bzl
2-
index 9e5cda6..851c8b7 100755
2+
index 9e5cda6..6c45196 100755
33
--- a/node_modules/@bazel/concatjs/internal/build_defs.bzl
44
+++ b/node_modules/@bazel/concatjs/internal/build_defs.bzl
55
@@ -76,7 +76,7 @@ _TYPESCRIPT_TYPINGS = Label(
@@ -11,3 +11,19 @@ index 9e5cda6..851c8b7 100755
1111
_TYPESCRIPT_MODULE_KINDS = ["none", "commonjs", "amd", "umd", "system", "es2015", "esnext"]
1212

1313
_DEVMODE_TARGET_DEFAULT = "es2015"
14+
diff --git a/node_modules/@bazel/concatjs/internal/common/tsconfig.bzl b/node_modules/@bazel/concatjs/internal/common/tsconfig.bzl
15+
index b01c999..ec3e4cc 100755
16+
--- a/node_modules/@bazel/concatjs/internal/common/tsconfig.bzl
17+
+++ b/node_modules/@bazel/concatjs/internal/common/tsconfig.bzl
18+
@@ -278,11 +278,6 @@ def create_tsconfig(
19+
"declarationDir": "/".join([workspace_path, outdir_path]),
20+
"stripInternal": True,
21+
22+
- # Embed source maps and sources in .js outputs
23+
- "inlineSourceMap": True,
24+
- "inlineSources": True,
25+
- # Implied by inlineSourceMap: True
26+
- "sourceMap": False,
27+
}
28+
29+
# "node_modules" still checked for backward compat for ng_module

0 commit comments

Comments
 (0)