Skip to content

Commit 1f04bf7

Browse files
alan-agius4filipesilva
authored andcommitted
refactor: remove path mappings from NgccProcessor
Path mappings are now inferred from the provided `tsconfig.json`, thus it's now redundant to provide them.
1 parent a6bf23b commit 1f04bf7

File tree

2 files changed

+1
-15
lines changed

2 files changed

+1
-15
lines changed

packages/ngtools/webpack/src/angular_compiler_plugin.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -765,7 +765,6 @@ export class AngularCompilerPlugin {
765765
this._warnings,
766766
this._errors,
767767
this._basePath,
768-
this._compilerOptions,
769768
this._tsConfigPath,
770769
);
771770

packages/ngtools/webpack/src/ngcc_processor.ts

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* found in the LICENSE file at https://angular.io/license
77
*/
88

9-
import { LogLevel, Logger, PathMappings, process as mainNgcc } from '@angular/compiler-cli/ngcc';
9+
import { LogLevel, Logger, process as mainNgcc } from '@angular/compiler-cli/ngcc';
1010
import { spawnSync } from 'child_process';
1111
import { accessSync, constants, existsSync } from 'fs';
1212
import * as path from 'path';
@@ -28,27 +28,17 @@ export class NgccProcessor {
2828
private _processedModules = new Set<string>();
2929
private _logger: NgccLogger;
3030
private _nodeModulesDirectory: string;
31-
private _pathMappings: PathMappings | undefined;
3231

3332
constructor(
3433
private readonly propertiesToConsider: string[],
3534
private readonly inputFileSystem: InputFileSystem,
3635
private readonly compilationWarnings: (Error | string)[],
3736
private readonly compilationErrors: (Error | string)[],
3837
private readonly basePath: string,
39-
private readonly compilerOptions: ts.CompilerOptions,
4038
private readonly tsConfigPath: string,
4139
) {
4240
this._logger = new NgccLogger(this.compilationWarnings, this.compilationErrors);
4341
this._nodeModulesDirectory = this.findNodeModulesDirectory(this.basePath);
44-
45-
const { baseUrl, paths } = this.compilerOptions;
46-
if (baseUrl && paths) {
47-
this._pathMappings = {
48-
baseUrl,
49-
paths,
50-
};
51-
}
5242
}
5343

5444
/** Process the entire node modules tree. */
@@ -130,9 +120,6 @@ export class NgccProcessor {
130120
compileAllFormats: false,
131121
createNewEntryPointFormats: true,
132122
logger: this._logger,
133-
// Path mappings are not longer required since NGCC 9.1
134-
// We keep using them to be backward compatible with NGCC 9.0
135-
pathMappings: this._pathMappings,
136123
tsConfigPath: this.tsConfigPath,
137124
});
138125
timeEnd(timeLabel);

0 commit comments

Comments
 (0)