Skip to content

Commit 0e91dfe

Browse files
hanslfilipesilva
authored andcommitted
fix(aot): remove the genDir plugin option.
We still consider the genDir property in the ngOptions of the tsconfig, to stay compatible with code that works with ngc. Fixes #2849. Close #2876
1 parent e9adc2c commit 0e91dfe

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

packages/webpack/src/plugin.ts

+6-7
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ export interface AotPluginOptions {
2020
tsConfigPath: string;
2121
basePath?: string;
2222
entryModule?: string;
23-
genDir?: string;
2423
mainPath?: string;
2524
typeChecking?: boolean;
2625
}
@@ -57,26 +56,27 @@ export class AotPlugin {
5756
private _compilation: any = null;
5857

5958
private _typeCheck: boolean = true;
59+
private _basePath: string;
6060

6161

6262
constructor(options: AotPluginOptions) {
6363
this._setupOptions(options);
6464
}
6565

66-
get basePath() { return this._angularCompilerOptions.basePath; }
66+
get basePath() { return this._basePath; }
6767
get compilation() { return this._compilation; }
6868
get compilerOptions() { return this._compilerOptions; }
6969
get done() { return this._donePromise; }
7070
get entryModule() { return this._entryModule; }
71-
get genDir() { return this._angularCompilerOptions.genDir; }
71+
get genDir() { return this._basePath; }
7272
get program() { return this._program; }
7373
get typeCheck() { return this._typeCheck; }
7474

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

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

9393
// Check the genDir.
9494
let genDir = basePath;
95-
if (options.hasOwnProperty('genDir')) {
96-
genDir = options.genDir;
97-
} else if (tsConfig.ngOptions.hasOwnProperty('genDir')) {
95+
if (tsConfig.ngOptions.hasOwnProperty('genDir')) {
9896
genDir = tsConfig.ngOptions.genDir;
9997
}
10098

@@ -114,6 +112,7 @@ export class AotPlugin {
114112
entryModule: this._entryModule.toString(),
115113
genDir
116114
});
115+
this._basePath = basePath;
117116

118117
if (options.hasOwnProperty('typeChecking')) {
119118
this._typeCheck = options.typeChecking;

0 commit comments

Comments
 (0)