Cloud Stack Ninja

In my Angular 8's angular.json file I have set an initial budget for production:

"production": {
    "optimization": true,
    "outputHashing": "all",
    "sourceMap": false,
    "extractCss": true,
    "namedChunks": false,
    "aot": true,
    "extractLicenses": true,
    "vendorChunk": true,
    "buildOptimizer": true,
    "fileReplacements": [{
        "replace": "src/environments/environment.ts",
        "with": "src/environments/"
    "budgets": [{
        "type": "initial",
        "maximumWarning": "1.5mb",
        "maximumError": "1.6mb"
    "serviceWorker": true

When I run ng build --prod the output errors:

Console output

However, none of the files tagged as initial have reached mentioned file size, neither alone nor together:

enter image description here

What is happening? Why is this error being thrown?

Note 1: Files get generated after removing budgets and running exactly same command, otherwise they don't get generated.

Note 2: Files generated seem to be duplicate, but that is Angular 8's differential loading (es5/es2015).

Note 3: Files generated don't even match in size with console output.

Read more here:

Content Attribution

This content was originally published by Jago at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: