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

fix(aot): remove the genDir plugin option. #2876

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 6 additions & 7 deletions packages/webpack/src/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ export interface AotPluginOptions {
tsConfigPath: string;
basePath?: string;
entryModule?: string;
genDir?: string;
mainPath?: string;
typeChecking?: boolean;
}
Expand Down Expand Up @@ -57,26 +56,27 @@ export class AotPlugin {
private _compilation: any = null;

private _typeCheck: boolean = true;
private _basePath: string;


constructor(options: AotPluginOptions) {
this._setupOptions(options);
}

get basePath() { return this._angularCompilerOptions.basePath; }
get basePath() { return this._basePath; }
get compilation() { return this._compilation; }
get compilerOptions() { return this._compilerOptions; }
get done() { return this._donePromise; }
get entryModule() { return this._entryModule; }
get genDir() { return this._angularCompilerOptions.genDir; }
get genDir() { return this._basePath; }
get program() { return this._program; }
get typeCheck() { return this._typeCheck; }

private _setupOptions(options: AotPluginOptions) {
// Fill in the missing options.
if (!options.hasOwnProperty('tsConfigPath')) {
throw new Error('Must specify "tsConfigPath" in the configuration of @ngtools/webpack.');
}
}

// Check the base path.
let basePath = path.resolve(process.cwd(), path.dirname(options.tsConfigPath));
Expand All @@ -92,9 +92,7 @@ export class AotPlugin {

// Check the genDir.
let genDir = basePath;
if (options.hasOwnProperty('genDir')) {
genDir = options.genDir;
} else if (tsConfig.ngOptions.hasOwnProperty('genDir')) {
if (tsConfig.ngOptions.hasOwnProperty('genDir')) {
genDir = tsConfig.ngOptions.genDir;
}

Expand All @@ -114,6 +112,7 @@ export class AotPlugin {
entryModule: this._entryModule.toString(),
genDir
});
this._basePath = basePath;

if (options.hasOwnProperty('typeChecking')) {
this._typeCheck = options.typeChecking;
Expand Down