Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(bazel): don't inline tslib into fesms #23044

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 5 additions & 0 deletions packages/bazel/test/ng_package/core_package.spec.ts
Expand Up @@ -122,6 +122,11 @@ describe('@angular/core ng_package', () => {
it('should not be processed by tsickle', () => {
expect(shx.cat('fesm5/core.js')).not.toContain('@fileoverview added by tsickle');
});

it('should load tslib from external bundle', () => {
expect(shx.cat('fesm5/core.js')).not.toContain('function __extends');
expect(shx.cat('fesm5/core.js')).toMatch('import {.*__extends');
});
});


Expand Down
5 changes: 4 additions & 1 deletion tools/defaults.bzl
Expand Up @@ -45,7 +45,7 @@ def ng_module(name, tsconfig = None, entry_point = None, **kwargs):
entry_point = "public_api.ts"
_ng_module(name = name, flat_module_out_file = name, tsconfig = tsconfig, entry_point = entry_point, **kwargs)

def ng_package(name, readme_md = None, license_banner = None, **kwargs):
def ng_package(name, readme_md = None, license_banner = None, globals = {}, **kwargs):
if not readme_md:
readme_md = "//packages:README.md"
if not license_banner:
Expand All @@ -55,6 +55,9 @@ def ng_package(name, readme_md = None, license_banner = None, **kwargs):
name = name,
readme_md = readme_md,
license_banner = license_banner,
globals = dict(globals, **{
"tslib": "tslib"
}),
replacements = PKG_GROUP_REPLACEMENTS,
**kwargs)

Expand Down