Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: remove path mappings from NgccProcessor #17896

Merged
merged 1 commit into from
Jun 10, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 0 additions & 1 deletion packages/ngtools/webpack/src/angular_compiler_plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -765,7 +765,6 @@ export class AngularCompilerPlugin {
this._warnings,
this._errors,
this._basePath,
this._compilerOptions,
this._tsConfigPath,
);

Expand Down
15 changes: 1 addition & 14 deletions packages/ngtools/webpack/src/ngcc_processor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* found in the LICENSE file at https://angular.io/license
*/

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

constructor(
private readonly propertiesToConsider: string[],
private readonly inputFileSystem: InputFileSystem,
private readonly compilationWarnings: (Error | string)[],
private readonly compilationErrors: (Error | string)[],
private readonly basePath: string,
private readonly compilerOptions: ts.CompilerOptions,
private readonly tsConfigPath: string,
) {
this._logger = new NgccLogger(this.compilationWarnings, this.compilationErrors);
this._nodeModulesDirectory = this.findNodeModulesDirectory(this.basePath);

const { baseUrl, paths } = this.compilerOptions;
if (baseUrl && paths) {
this._pathMappings = {
baseUrl,
paths,
};
}
}

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