Skip to content

Lazy global styles marked as initial - Messing up initial budgets #13433

@drakenfly

Description

@drakenfly

Bug Report or Feature Request (mark with an x)

- [x ] bug report -> please search issues before submitting
- [ ] feature request

Command (mark with an x)

- [ ] new
- [x ] build
- [x ] serve
- [ ] test
- [ ] e2e
- [ ] generate
- [ ] add
- [ ] update
- [ ] lint
- [ ] xi18n
- [ ] run
- [ ] config
- [ ] help
- [ ] version
- [ ] doc

Versions

node --version - v8.10.0
npm --version - 5.7.1
ng --version:



     _                      _                 ____ _     ___
    / \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|
   / △ \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | |
  / ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |
 /_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
                |___/


Angular CLI: 7.1.2
Node: 8.9.1
OS: win32 x64
Angular: 7.1.3
... animations, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router

Package                            Version
------------------------------------------------------------
@angular-devkit/architect          0.12.1
@angular-devkit/build-angular      0.12.1
@angular-devkit/build-ng-packagr   0.12.1
@angular-devkit/build-optimizer    0.12.1
@angular-devkit/build-webpack      0.12.1
@angular-devkit/core               7.2.1
@angular-devkit/schematics         7.1.2
@angular/cdk                       7.1.1
@angular/cli                       7.1.2
@angular/flex-layout               7.0.0-beta.19
@angular/material                  7.1.1
@angular/material-moment-adapter   7.1.1
@ngtools/json-schema               1.1.0
@ngtools/webpack                   7.2.1
@schematics/angular                7.1.2
@schematics/update                 0.11.2
ng-packagr                         4.4.5
rxjs                               6.3.3
typescript                         3.1.6
webpack                            4.23.1

Windows 10

Repro steps

Add a lazy loaded style to projects.architect.build.styles:

{
    "input": ".../some/path/my.theme.scss",
    "bundleName": "my.theme",
    "lazy": true
}

Add a budget with type initial:

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

The log given by the failure

This produces following output on ng serve or build:
chunk {my.theme} my.theme.css, my.theme.css.map (my.theme) 215 kB [initial] [rendered].

Desired functionality

I don't think that lazy CSS should be marked as [initial], as it messes up budget calculation (for example, if you have 10 pre-built themes).

Mention any other details that might be useful

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions