1
- import { ArchitectCommand } from '../models/architect-command' ;
2
1
import { Option , CommandScope } from '../models/command' ;
3
2
import { Version } from '../upgrade/version' ;
4
-
5
- export interface Options {
6
- project ?: string ;
7
- configuration ?: string ;
8
- prod : boolean ;
9
- }
3
+ import { ArchitectCommand , ArchitectCommandOptions } from '../models/architect-command' ;
10
4
11
5
export default class BuildCommand extends ArchitectCommand {
12
6
public readonly name = 'build' ;
@@ -20,29 +14,14 @@ export default class BuildCommand extends ArchitectCommand {
20
14
this . configurationOption
21
15
] ;
22
16
23
- public validate ( options : Options ) {
17
+ public validate ( options : ArchitectCommandOptions ) {
24
18
// Check Angular and TypeScript versions.
25
19
Version . assertCompatibleAngularVersion ( this . project . root ) ;
26
20
Version . assertTypescriptVersion ( this . project . root ) ;
27
21
return super . validate ( options ) ;
28
22
}
29
23
30
- public async run ( options : Options ) {
31
- let configuration = options . configuration ;
32
- if ( ! configuration && options . prod ) {
33
- configuration = 'production' ;
34
- }
35
-
36
- const overrides = { ...options } ;
37
- delete overrides . project ;
38
- delete overrides . configuration ;
39
- delete overrides . prod ;
40
-
41
- return this . runArchitectTarget ( {
42
- project : options . project ,
43
- target : this . target ,
44
- configuration,
45
- overrides
46
- } , options ) ;
24
+ public async run ( options : ArchitectCommandOptions ) {
25
+ return this . runArchitectTarget ( options ) ;
47
26
}
48
27
}
0 commit comments