angular/tools
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
..
bazel build: introduce NodeJS loader for rules_js Node execution (#61865) 2025-06-05 12:04:51 +02:00
contributing-stats refactor: update license text to point to angular.dev (#57901) 2024-09-24 15:33:00 +02:00
esm-interop build: rework benchmarks and examples in modules/ to new optimization rule (#61566) 2025-05-29 14:39:11 -04:00
gulp-tasks refactor: update license text to point to angular.dev (#57901) 2024-09-24 15:33:00 +02:00
legacy-saucelabs refactor: replace fast-glob usage with tinyglobby (#60264) 2025-03-07 10:57:23 -08:00
manual_api_docs docs: call out the available variables in track expressions (#61252) 2025-05-16 07:51:09 +00:00
npm-patches refactor(devtools): add dagre-d3-es (#61538) 2025-05-21 09:56:40 +00:00
saucelabs ci: remove circleci as we no longer rely on it (#58615) 2024-11-12 18:39:25 +00:00
saucelabs-daemon build: update tools directory to use rules_js for building (#61656) 2025-05-26 09:01:13 +00:00
symbol-extractor build: rework symbol extractor to support lazy/common chunks (#61566) 2025-05-29 14:39:11 -04:00
testing build: update tools directory to use rules_js for building (#61656) 2025-05-26 09:01:13 +00:00
tslint refactor: add explicit types for exports relying on inferred call return type (#61312) 2025-05-13 22:45:18 +00:00
BUILD.bazel build: migrate symbol-extractor to ts_project (#61156) 2025-05-07 11:28:59 -07:00
defaults.bzl build: replace all ng_package with new rule from rules_angular (#61843) 2025-06-04 09:13:41 +00:00
defaults2.bzl build: replace all ng_package with new rule from rules_angular (#61843) 2025-06-04 09:13:41 +00:00
jsconfig.json chore(vscode): add jsconfig.json and remove .settings dir 2015-10-29 13:53:21 +00:00
ng_benchmark.bzl refactor: update license text to point to angular.dev (#57901) 2024-09-24 15:33:00 +02:00
postinstall-patches.js refactor: update license text to point to angular.dev (#57901) 2024-09-24 15:33:00 +02:00
tsconfig-test.json build: migrate symbol-extractor to ts_project (#61156) 2025-05-07 11:28:59 -07:00
tsconfig.json build: update tools directory to use rules_js for building (#61656) 2025-05-26 09:01:13 +00:00
types.d.ts refactor: update license text to point to angular.dev (#57901) 2024-09-24 15:33:00 +02:00