@@ -15,7 +15,12 @@ export default Blueprint.extend({
15
15
{ name : 'routing' , type : Boolean , default : false } ,
16
16
{ name : 'inline-style' , type : Boolean , default : false , aliases : [ 'is' ] } ,
17
17
{ name : 'inline-template' , type : Boolean , default : false , aliases : [ 'it' ] } ,
18
- { name : 'skip-git' , type : Boolean , default : false , aliases : [ 'sg' ] }
18
+ { name : 'skip-git' , type : Boolean , default : false , aliases : [ 'sg' ] } ,
19
+ { name : 'minimal' ,
20
+ type : Boolean ,
21
+ default : false ,
22
+ description : 'Should create a minimal app.'
23
+ }
19
24
] ,
20
25
21
26
beforeInstall : function ( options : any ) {
@@ -26,6 +31,12 @@ export default Blueprint.extend({
26
31
} ,
27
32
28
33
locals : function ( options : any ) {
34
+ if ( options . minimal ) {
35
+ options . inlineStyle = true ;
36
+ options . inlineTemplate = true ;
37
+ options . skipTests = true ;
38
+ }
39
+
29
40
this . styleExt = options . style === 'stylus' ? 'styl' : options . style ;
30
41
if ( ! options . style ) {
31
42
this . styleExt = CliConfig . getValue ( 'defaults.styleExt' ) || 'css' ;
@@ -54,7 +65,8 @@ export default Blueprint.extend({
54
65
routing : options . routing ,
55
66
inlineStyle : options . inlineStyle ,
56
67
inlineTemplate : options . inlineTemplate ,
57
- tests : this . tests
68
+ tests : this . tests ,
69
+ minimal : options . minimal
58
70
} ;
59
71
} ,
60
72
@@ -78,6 +90,14 @@ export default Blueprint.extend({
78
90
fileList = fileList . filter ( p => p . indexOf ( 'app.component.spec.ts' ) < 0 ) ;
79
91
}
80
92
93
+ if ( this . options && this . options . minimal ) {
94
+ const toRemoveList : RegExp [ ] = [ / e 2 e \/ / , / e d i t o r c o n f i g / , / R E A D M E / , / k a r m a .c o n f .j s / ,
95
+ / p r o t r a c t o r .c o n f .j s / , / t e s t .t s / , / t s c o n f i g .s p e c .j s o n / , / t s l i n t .j s o n / , / f a v i c o n .i c o / ] ;
96
+ fileList = fileList . filter ( p => {
97
+ return ! toRemoveList . some ( re => re . test ( p ) ) ;
98
+ } ) ;
99
+ }
100
+
81
101
const cliConfig = CliConfig . fromProject ( ) ;
82
102
const ngConfig = cliConfig && cliConfig . config ;
83
103
if ( ! ngConfig || ngConfig . packageManager != 'yarn' ) {
0 commit comments