1

I am facing an issue while deploying the code and I get

 Warning: bundle initial exceeded maximum budget. Budget 2.00 MB was not met by 9.05 MB with a total of 11.05 MB.

 Error: bundle initial exceeded maximum budget. Budget 5.00 MB was not met by 6.05 MB with a total of 11.05 MB.

My budgets object in angular.json file is -

"budgets": [
            {
              "type": "initial",
              "maximumWarning": "2mb",
              "maximumError": "5mb"
            },
            {
              "type": "anyComponentStyle",
              "maximumWarning": "6kb"
            }
          ]

And I tried various combinations as referred to in these sites -

WARNING in budgets, maximum exceeded for initial

Warning: budgets: initial exceeded maximum budget

I tried -

    "budgets": [
            {
              "type": "initial",
              "maximumWarning": "12mb",
              "maximumError": "14mb"
            },
            {
              "type": "anyComponentStyle",
              "maximumWarning": "9kb",
              "maximumError": "2mb"
            
            }
          ]

But it did not help. Kindly suggest.

1 Answers1

1

I solved the issue with the following combination -

"budgets": [
            {
              "type": "initial",
              "maximumWarning": "7mb",
              "maximumError": "14mb"
            },
            {
              "type": "anyComponentStyle",
              "maximumWarning": "6kb"
            }
          ]

Also, it was present at multiple places in angular.json file . So added the same in multiple places.