@@ -65,31 +65,7 @@ export class CliConfig extends CliConfigBase<ConfigInterface> {
65
65
66
66
const cliConfig = CliConfigBase . fromConfigPath < ConfigInterface > ( globalConfigPath ) ;
67
67
68
- const aliases = [
69
- cliConfig . alias ( 'apps.0.root' , 'defaults.sourceDir' ) ,
70
- cliConfig . alias ( 'apps.0.prefix' , 'defaults.prefix' )
71
- ] ;
72
-
73
- // Additional aliases which do not emit any messages.
74
- cliConfig . alias ( 'defaults.interface.prefix' , 'defaults.inline.prefixInterfaces' ) ;
75
- cliConfig . alias ( 'defaults.component.inlineStyle' , 'defaults.inline.style' ) ;
76
- cliConfig . alias ( 'defaults.component.inlineTemplate' , 'defaults.inline.template' ) ;
77
- cliConfig . alias ( 'defaults.component.spec' , 'defaults.spec.component' ) ;
78
- cliConfig . alias ( 'defaults.class.spec' , 'defaults.spec.class' ) ;
79
- cliConfig . alias ( 'defaults.component.directive' , 'defaults.spec.directive' ) ;
80
- cliConfig . alias ( 'defaults.component.module' , 'defaults.spec.module' ) ;
81
- cliConfig . alias ( 'defaults.component.pipe' , 'defaults.spec.pipe' ) ;
82
- cliConfig . alias ( 'defaults.component.service' , 'defaults.spec.service' ) ;
83
-
84
- // If any of them returned true, output a deprecation warning.
85
- if ( aliases . some ( x => x ) ) {
86
- console . error ( chalk . yellow ( oneLine `
87
- The "defaults.prefix" and "defaults.sourceDir" properties of .angular-cli.json
88
- are deprecated in favor of "apps[0].root" and "apps[0].prefix".\n
89
- Please update in order to avoid errors in future versions of Angular CLI.
90
- ` ) ) ;
91
- }
92
-
68
+ CliConfig . addAliases ( cliConfig ) ;
93
69
configCacheMap . set ( globalConfigPath , cliConfig ) ;
94
70
return cliConfig ;
95
71
}
@@ -108,11 +84,28 @@ export class CliConfig extends CliConfigBase<ConfigInterface> {
108
84
const globalConfigPath = CliConfig . globalConfigFilePath ( ) ;
109
85
const cliConfig = CliConfigBase . fromConfigPath < ConfigInterface > ( configPath , [ globalConfigPath ] ) ;
110
86
87
+ CliConfig . addAliases ( cliConfig ) ;
88
+ configCacheMap . set ( configPath , cliConfig ) ;
89
+ return cliConfig as CliConfig ;
90
+ }
91
+
92
+ static addAliases ( cliConfig : CliConfigBase < ConfigInterface > ) {
93
+
94
+ // Aliases with deprecation messages.
111
95
const aliases = [
112
96
cliConfig . alias ( 'apps.0.root' , 'defaults.sourceDir' ) ,
113
97
cliConfig . alias ( 'apps.0.prefix' , 'defaults.prefix' )
114
98
] ;
115
99
100
+ // If any of them returned true, output a deprecation warning.
101
+ if ( aliases . some ( x => x ) ) {
102
+ console . error ( chalk . yellow ( oneLine `
103
+ The "defaults.prefix" and "defaults.sourceDir" properties of .angular-cli.json
104
+ are deprecated in favor of "apps[0].root" and "apps[0].prefix".\n
105
+ Please update in order to avoid errors in future versions of Angular CLI.
106
+ ` ) ) ;
107
+ }
108
+
116
109
// Additional aliases which do not emit any messages.
117
110
cliConfig . alias ( 'defaults.interface.prefix' , 'defaults.inline.prefixInterfaces' ) ;
118
111
cliConfig . alias ( 'defaults.component.inlineStyle' , 'defaults.inline.style' ) ;
@@ -123,17 +116,6 @@ export class CliConfig extends CliConfigBase<ConfigInterface> {
123
116
cliConfig . alias ( 'defaults.component.module' , 'defaults.spec.module' ) ;
124
117
cliConfig . alias ( 'defaults.component.pipe' , 'defaults.spec.pipe' ) ;
125
118
cliConfig . alias ( 'defaults.component.service' , 'defaults.spec.service' ) ;
126
-
127
- // If any of them returned true, output a deprecation warning.
128
- if ( aliases . some ( x => x ) ) {
129
- console . error ( chalk . yellow ( oneLine `
130
- The "defaults.prefix" and "defaults.sourceDir" properties of .angular-cli.json
131
- are deprecated in favor of "apps[0].root" and "apps[0].prefix".\n
132
- Please update in order to avoid errors in future versions of Angular CLI.
133
- ` ) ) ;
134
- }
135
-
136
- configCacheMap . set ( configPath , cliConfig ) ;
137
- return cliConfig as CliConfig ;
119
+ cliConfig . alias ( 'defaults.build.poll' , 'defaults.poll' ) ;
138
120
}
139
121
}
0 commit comments