Skip to content

Add style preprocessor option to disable deprecation warnings in Sass for V19 #28829

@L-X-T

Description

@L-X-T

Which @angular/* package(s) are relevant/related to the feature request?

No response

Description

After updating @angular to v19, I’ve encountered a ton SCSS compiler deprecation warnings across many of my Angular projects. This issue occurs because the “sass” dependency in @angular/build/package.json was updated from “1.77.6” to “1.80.6”. As a temporary workaround, I reverted this dependency to “1.77.6” in the project’s node_modules directory, although this is - quite obvious - not ideal.

Ideally, we should remove deprecated SCSS code in our scss files and 3rd party dependencies (this is where it becomes a nightmare). However, as a temporary solution to silence these deprecation warnings and be relieved when running “ng s“, it would be helpful to pass a “stylePreprocessorOptions” (already exists) flag via “angular.json“ into the Sass compiler.

Please note that in Nuxt/Vite and Ember, disabling these deprecation warnings is already possible, see here and here.

Proposed solution

Additional option in “angular.json". (Should default to false.)

"stylePreprocessorOptions": {
  "silenceDeprecations": true
},

This should result in passing the flag "--quiet-deps" to the sass compiler. How to silence this warnings internally can be learned here: https://sass-lang.com/documentation/breaking-changes/mixed-decls/#silencing-deprecations-in-dependencies

Alternatives considered

Downgrade sass dep to “1.77.6“.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions