File tree 1 file changed +29
-11
lines changed
packages/schematics/angular/application
1 file changed +29
-11
lines changed Original file line number Diff line number Diff line change @@ -179,6 +179,34 @@ function addAppToWorkspaceFile(options: ApplicationOptions, appDir: string): Rul
179
179
}
180
180
181
181
const sourceRoot = join ( normalize ( projectRoot ) , 'src' ) ;
182
+ let budgets = [ ] ;
183
+ if ( options . strict ) {
184
+ budgets = [
185
+ {
186
+ type : 'initial' ,
187
+ maximumWarning : '500kb' ,
188
+ maximumError : '1mb' ,
189
+ } ,
190
+ {
191
+ type : 'anyComponentStyle' ,
192
+ maximumWarning : '2kb' ,
193
+ maximumError : '4kb' ,
194
+ } ,
195
+ ] ;
196
+ } else {
197
+ budgets = [
198
+ {
199
+ type : 'initial' ,
200
+ maximumWarning : '2mb' ,
201
+ maximumError : '5mb' ,
202
+ } ,
203
+ {
204
+ type : 'anyComponentStyle' ,
205
+ maximumWarning : '6kb' ,
206
+ maximumError : '10kb' ,
207
+ } ,
208
+ ] ;
209
+ }
182
210
183
211
const project = {
184
212
root : normalize ( projectRoot ) ,
@@ -219,17 +247,7 @@ function addAppToWorkspaceFile(options: ApplicationOptions, appDir: string): Rul
219
247
extractLicenses : true ,
220
248
vendorChunk : false ,
221
249
buildOptimizer : true ,
222
- budgets : [
223
- {
224
- type : 'initial' ,
225
- maximumWarning : '2mb' ,
226
- maximumError : '5mb' ,
227
- } ,
228
- {
229
- type : 'anyComponentStyle' ,
230
- maximumWarning : '6kb' ,
231
- maximumError : '10kb' ,
232
- } ] ,
250
+ budgets,
233
251
} ,
234
252
} ,
235
253
} ,
You can’t perform that action at this time.
0 commit comments