Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

initial budget doesn't trigger #11712

Closed
StephenFluin opened this issue Jul 30, 2018 · 2 comments · Fixed by #11756
Closed

initial budget doesn't trigger #11712

StephenFluin opened this issue Jul 30, 2018 · 2 comments · Fixed by #11756

Comments

@StephenFluin
Copy link
Contributor

Bug Report or Feature Request (mark with an x)

- [X] bug report -> please search issues before submitting

Command (mark with an x)

- [x] build

Versions

Angular CLI: 6.1.1
Node: 10.6.0
OS: linux x64
Angular: 6.1.0
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, router

Package Version

@angular-devkit/architect 0.7.1
@angular-devkit/build-angular 0.7.1
@angular-devkit/build-optimizer 0.7.1
@angular-devkit/build-webpack 0.7.1
@angular-devkit/core 0.7.1
@angular-devkit/schematics 0.7.1
@angular/cdk 6.4.1
@angular/cli 6.1.1
@angular/material 6.4.1
@ngtools/webpack 6.1.1
@schematics/angular 0.7.1
@schematics/update 0.7.1
rxjs 6.2.2
typescript 2.7.2
webpack 4.9.2

Repro steps

  • ng new my-app
  • add 1MB to bundle so bundle is more than 1MB>
  • add budget to production config
"configurations": {
            "production": {
              "fileReplacements": [
                {
                  "replace": "src/environments/environment.ts",
                  "with": "src/environments/environment.prod.ts"
                }
              ],
              "budgets": [
                {
                  "type": "initial",
                  "maximumError": "2mb",
                  "maximumWarning": "1mb"
                }
              ],
              "optimization": true,
              "outputHashing": "all",
              "sourceMap": false,
              "extractCss": true,
              "namedChunks": false,
              "aot": true,
              "extractLicenses": true,
              "vendorChunk": false,
              "buildOptimizer": true
            }
          }
  • ng build --prod

The log given by the failure

$ ng build --prod
                                                                                       
Date: 2018-07-30T21:13:49.067Z
Hash: 677e685692de6cf92ad3
Time: 42319ms
chunk {0} runtime.a66f828dca56eeb90e02.js (runtime) 1.05 kB [entry] [rendered]
chunk {1} styles.1c3d66f2dd8412dae789.css (styles) 56.2 kB [initial] [rendered]
chunk {2} polyfills.7a0e6866a34e280f48e7.js (polyfills) 59.6 kB [initial] [rendered]
chunk {3} main.33c9a4510519d4aa7f61.js (main) 1.59 MB [initial] [rendered]

Desired functionality

A warning about being over 1MB is expected.
If I halve the sizes to 500kb warning and 1mb error, I get the same behavior and no error or warning is triggered.

Mention any other details that might be useful

I think that minimum (and related settings is confusing) and could be deprecated and removed in a future major.

@Brocco
Copy link
Contributor

Brocco commented Aug 2, 2018

To clarify, this issue existed only when using a budget of type initial as the logic to determine the initial sizes changed with webpack versions. PR to address is #11756

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 8, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants