Fix a “WARNING/ERROR in budgets, maximum exceeded for initial” in Angular

The warning or an error can appear and be related to the maximum budgets parameter:

Error: bundle initial exceeded maximum budget. Budget 1.00 MB was not met by 22.68 kB with a total of 1.02 MB.

Should be tuned budgets module in the angular.json file of the Angular project

"budgets": [
                 {
                   "type": "initial",
                   "maximumWarning": "500kb",
                   "maximumError": "1mb"
                 },
                 {
                   "type": "anyComponentStyle",
                   "maximumWarning": "6kb",
                   "maximumError": "10kb"
                 }
               ]
"budgets": [
                 {
                   "type": "initial",
                   "maximumWarning": "2mb",
                   "maximumError": "5mb"
                 },
                 {
                   "type": "anyComponentStyle",
                   "maximumWarning": "6kb",
                   "maximumError": "10kb"
                 }
               ]
Translate »