Skip to content

Commit e98e371

Browse files
committed
build: include tslib as explicit dependency for ng_package r… (#18720)
In a previous commit we removed `tslib` from the rollup globals so that `ng_package` can bundle `tslib` into the UMD bundles. This works fine in non-sandbox environments (e.g. windows), but doesn't work in sandbox environments because `ng_package` does not bring in transitive dependencies from entry-points. Hence we need to explicitly pass in `tslib` as dependency for `ng_package`. This matches what `angular/angular` does for including tslib.
1 parent 37d8ede commit e98e371

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

tools/defaults.bzl

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ def ng_module(
100100
**kwargs
101101
)
102102

103-
def ng_package(name, data = [], globals = ROLLUP_GLOBALS, readme_md = None, **kwargs):
103+
def ng_package(name, data = [], deps = [], globals = ROLLUP_GLOBALS, readme_md = None, **kwargs):
104104
# If no readme file has been specified explicitly, use the default readme for
105105
# release packages from "src/README.md".
106106
if not readme_md:
@@ -119,6 +119,10 @@ def ng_package(name, data = [], globals = ROLLUP_GLOBALS, readme_md = None, **kw
119119
name = name,
120120
globals = globals,
121121
data = data + [":license_copied"],
122+
# Tslib needs to be explicitly specified as dependency here, so that the `ng_package`
123+
# rollup bundling action can include tslib. Tslib is usually a transitive dependency of
124+
# entry-points passed to `ng_package`, but the rule does not collect transitive deps.
125+
deps = deps + ["@npm//tslib"],
122126
readme_md = readme_md,
123127
substitutions = VERSION_PLACEHOLDER_REPLACEMENTS,
124128
**kwargs

0 commit comments

Comments
 (0)