angular/packages/bazel/index.bzl
Paul Gschwendtner 044dac98c9 feat(bazel): support bundling .d.ts with code splitting (#60321) (#60332)
Instead of relying on Microsoft's API extractor for `d.ts` bundling,
we are switching to Rollup-based `.d.ts` bundling.

This allows us to support code spliting, even for `.d.ts` files,
allowing for relative imports to be used between entry-points, without
ending up duplicating `.d.ts` definitions in two files. This would otherwise cause
problems with assignability of types.

It also nicely integrates into our existing rollup configuration, and
overall simplifies the `ng_package` rule even further!

Notably `tsup` also uses this rollup plugin, and it seems to work well.
Keep in mind that Microsoft's API extractor is pretty hard to integrate,
caused many problems in the past, and isn't capable of code splitting.
This aligns our d.ts bundling with the .mjs bundling (great alignment).

PR Close #60321

PR Close #60332
2025-03-11 15:33:05 -07:00

17 lines
625 B
Python

# Copyright Google LLC All Rights Reserved.
#
# Use of this source code is governed by an MIT-style license that can be
# found in the LICENSE file at https://angular.dev/license
""" Public API surface is re-exported here.
Users should not load files under "/src"
"""
load("//packages/bazel/src/ng_module:ng_module.bzl", _ng_module = "ng_module_macro")
load("//packages/bazel/src/ng_package:ng_package.bzl", _ng_package = "ng_package_macro")
ng_module = _ng_module
ng_package = _ng_package
# DO NOT ADD PUBLIC API without including in the documentation generation
# Run `yarn bazel build //packages/bazel/docs` to verify