Skip to content
This repository was archived by the owner on Nov 22, 2024. It is now read-only.

Commit eadf4d4

Browse files
authored
build: embed tslib in umd bundles (#1760)
When tslib is listed as part of the globals, it will not be embedded in the UMD bundles. https://github.com/angular/angular/blob/fd65958b887f6ea8dd5235e6de1d533e4c578602/packages/bazel/src/ng_package/ng_package.bzl#L226-L228 Users using UMD bundles, shouldn't be needing to add the tslib script, also this is important because tslib is a direct depedency of the package and not a peer depedency. This is also to align with the Angular FW packages.
1 parent 9e0a150 commit eadf4d4

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

tools/defaults.bzl

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,6 @@ GLOBALS = {
8080
"@hapi/hapi": "hapi.hapi",
8181
"rxjs": "rxjs",
8282
"rxjs/operators": "rxjs.operators",
83-
"tslib": "tslib",
8483
}
8584

8685
def ng_module(name, tsconfig = None, testonly = False, deps = [], bundle_dts = True, **kwargs):
@@ -127,10 +126,12 @@ def ng_test_library(deps = [], tsconfig = None, **kwargs):
127126
**kwargs
128127
)
129128

130-
def ng_package(globals = {}, **kwargs):
129+
def ng_package(globals = {}, deps = [], **kwargs):
131130
globals = dict(globals, **GLOBALS)
132-
133-
_ng_package(globals = globals, substitutions = PKG_GROUP_REPLACEMENTS, **kwargs)
131+
deps = deps + [
132+
"@npm//tslib",
133+
]
134+
_ng_package(globals = globals, deps = deps, substitutions = PKG_GROUP_REPLACEMENTS, **kwargs)
134135

135136
def pkg_npm(name, substitutions = {}, **kwargs):
136137
_pkg_npm(

0 commit comments

Comments
 (0)