angular/tools/bazel
Paul Gschwendtner d86d11d4c1 build: introduce NodeJS loader for rules_js Node execution (#61865)
For the `rules_js` migration, we are facing the problem where
our current Angular code is shipped as ESM, but we aren't fully
there yet with fully compliant strict ESM during development.

That is because we lack explicit import extensions, and it's also a
different story how this would work in Google3, if we were to add them.

In addition, we cross-import from our packages using npm module names.
This works well for TS, for ESBuild because those can respect path
mappings— but at runtime, when executing native `jasmine_test`'s— such
mappings aren't respected. The options here are:

- avoid module imports in the repo (impossible; undesired)
- use pre-bundling of all NodeJS execution involving npm package code
  (slower, extra build action cost)
- wire up a simple NodeJS loader (supported via official APIs) to simply
  account for our cases (preferred and similar to what we experimented
  with for the last year(s); and worked well)

This commit implements the last option and allows for an easy migration
to `rules_js`, and also is pretty reasonable. Long-term we can resolve
the extension problem if we e.g. migrate to real explicit extensions + a
proper TS module resolution like e.g. `nodenext`.

PR Close #61865
2025-06-05 12:04:51 +02:00
..
node_loader build: introduce NodeJS loader for rules_js Node execution (#61865) 2025-06-05 12:04:51 +02:00
rules_angular_store build: support new ng_project rule (#61275) 2025-05-14 12:01:51 +00:00
BUILD.bazel build: set up ts_project interop for rules_js migration (#61087) 2025-05-02 09:12:23 -07:00
js_binary.bzl build: introduce NodeJS loader for rules_js Node execution (#61865) 2025-06-05 12:04:51 +02:00
module_name.bzl build: remove packages/bazel (#61843) 2025-06-04 09:13:41 +00:00
ng_package.bzl build: replace all ng_package with new rule from rules_angular (#61843) 2025-06-04 09:13:41 +00:00
ng_package_link_interop.bzl build: replace all ng_package with new rule from rules_angular (#61843) 2025-06-04 09:13:41 +00:00
ts_project_interop.bzl build: fix ts_project interop to properly create linker mappings (#61275) 2025-05-14 12:01:51 +00:00
tsec.bzl build: add modified version of tsec that can work with interop (#61275) 2025-05-14 12:01:51 +00:00