mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
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:
@@ -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'),
|
||||
})));
|
||||
|
||||
Reference in New Issue
Block a user