Skip to content

Removing ExtractCss: true from angular.json loads css in style tags, instead of a stylesheet link #20419

@JenPeleva

Description

@JenPeleva

🐞 Bug report

According to the release notes for version 11 (https://github.com/angular/angular-cli/releases/tag/v11.0.0-next.0 ) ExtractCss property can now be removed from angular.json, because its default value is set to true. However, if I don't explicitly set it to true, my project css is loaded in style tags, instead of the expected stylesheet link.

🔬 Minimal Reproduction

This can be reproduced on a new instance.

  1. Create a new project with scss styles.
  2. go to angular.json and add "extractCss": true to the build options
  3. Result: the project styles are loaded in a stylesheet link:
  4. Remove the "extractCss": false and build the project again
  5. Result: Styles are loaded in <style> tags.
    Expected: The behavior shouldn't change and styles should be loaded in a stylesheet link.

At least this is how the breaking change has been described in your release notes:

@angular-devkit/build-angular: deprecate extractCss browser builder option (dd26018)
Browser builder extractCss option default value has been changed from false to true. This is to reflect the default behaviour when this deprecated option is removed.

Thank you for your help. :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions