build: adopt moduleResolution: "bundler" (#64125)

This commit updates the TypeScript configuration across the project to use `moduleResolution: "bundler"`. This modernizes our module resolution strategy to align with current TypeScript best practices and bundler behaviors.

The following changes are included:
- Updated `tsconfig.json` files to set `moduleResolution` to `"bundler"`.
- Updated the `rules_angular` bazel dependency to a version compatible with these changes.
- Adjusted related test files and golden files to reflect the new module resolution strategy.

PR Close #64125
This commit is contained in:
Alan Agius
2025-09-29 14:32:10 +00:00
committed by kirjs
parent 377d1a0aea
commit fc643c9044
36 changed files with 70 additions and 60 deletions
@@ -37,7 +37,7 @@ export function makeProgram(
const compilerOptions = {
noLib: true,
experimentalDecorators: true,
moduleResolution: ts.ModuleResolutionKind.Node10,
moduleResolution: ts.ModuleResolutionKind.Bundler,
...options,
};
const compilerHost = new NgtscTestCompilerHost(fs, compilerOptions);
@@ -173,7 +173,7 @@ export function angularCoreDtsFiles(): TestFile[] {
const directory = resolveFromRunfiles('_main/packages/core/npm_package');
const dtsFiles = globSync('**/*.d.ts', {cwd: directory});
return (_angularCoreDts = dtsFiles.map((fileName) => ({
return (_angularCoreDts = ['package.json', ...dtsFiles].map((fileName) => ({
name: absoluteFrom(`/node_modules/@angular/core/${fileName}`),
contents: readFileSync(path.join(directory, fileName), 'utf8'),
})));