@@ -20,7 +20,6 @@ export interface AotPluginOptions {
20
20
tsConfigPath : string ;
21
21
basePath ?: string ;
22
22
entryModule ?: string ;
23
- genDir ?: string ;
24
23
mainPath ?: string ;
25
24
typeChecking ?: boolean ;
26
25
}
@@ -57,26 +56,27 @@ export class AotPlugin {
57
56
private _compilation : any = null ;
58
57
59
58
private _typeCheck : boolean = true ;
59
+ private _basePath : string ;
60
60
61
61
62
62
constructor ( options : AotPluginOptions ) {
63
63
this . _setupOptions ( options ) ;
64
64
}
65
65
66
- get basePath ( ) { return this . _angularCompilerOptions . basePath ; }
66
+ get basePath ( ) { return this . _basePath ; }
67
67
get compilation ( ) { return this . _compilation ; }
68
68
get compilerOptions ( ) { return this . _compilerOptions ; }
69
69
get done ( ) { return this . _donePromise ; }
70
70
get entryModule ( ) { return this . _entryModule ; }
71
- get genDir ( ) { return this . _angularCompilerOptions . genDir ; }
71
+ get genDir ( ) { return this . _basePath ; }
72
72
get program ( ) { return this . _program ; }
73
73
get typeCheck ( ) { return this . _typeCheck ; }
74
74
75
75
private _setupOptions ( options : AotPluginOptions ) {
76
76
// Fill in the missing options.
77
77
if ( ! options . hasOwnProperty ( 'tsConfigPath' ) ) {
78
78
throw new Error ( 'Must specify "tsConfigPath" in the configuration of @ngtools/webpack.' ) ;
79
- }
79
+ }
80
80
81
81
// Check the base path.
82
82
let basePath = path . resolve ( process . cwd ( ) , path . dirname ( options . tsConfigPath ) ) ;
@@ -92,9 +92,7 @@ export class AotPlugin {
92
92
93
93
// Check the genDir.
94
94
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' ) ) {
98
96
genDir = tsConfig . ngOptions . genDir ;
99
97
}
100
98
@@ -114,6 +112,7 @@ export class AotPlugin {
114
112
entryModule : this . _entryModule . toString ( ) ,
115
113
genDir
116
114
} ) ;
115
+ this . _basePath = basePath ;
117
116
118
117
if ( options . hasOwnProperty ( 'typeChecking' ) ) {
119
118
this . _typeCheck = options . typeChecking ;
0 commit comments