Skip to content

Karma builder: support sass in stylePreprocessorOptions with "builderMode: application" #29185

@cexbrayat

Description

@cexbrayat

Command

test

Description

It is currently impossible to define the sass option in stylePreprocessorOptions for the Karma builder, which makes it impossible to silence Sass deprecations with "builderMode: application."

"test": {
  "builder": "@angular-devkit/build-angular:karma",
  "options": {
  "builderMode": "application",
  "stylePreprocessorOptions": {
    "sass": {
      "silenceDeprecations": ["import"]
    }
  },

throws:

Error: Schema validation failed with the following errors:
  Data path "/stylePreprocessorOptions" must NOT have additional properties(sass).

Describe the solution you'd like

stylePreprocessorOptions allows to set includePaths but it would be great to handle sass options as well, like the application builder does.

Describe alternatives you've considered

No response

Activity

alan-agius4

alan-agius4 commented on Dec 19, 2024

@alan-agius4
Collaborator

This is similar to #28809, @jkrems up to you if you want to merge these 2 issues.

bst-celum

bst-celum commented on Dec 27, 2024

@bst-celum

The same is true for the @angular-devkit/build-angular:browser builder which we are using through the @angular-builders/custom-webpack library. (https://github.com/just-jeb/angular-builders/tree/master/packages/custom-webpack#custom-webpack-browser)

@alan-agius4 is the recommendation in general to switch to build-angular:application, also for applications which will only run in the browser? Is there documentation for this switch (explanations, things-to-consider, etc.) - it would be very helpful in understanding why/what and how we can migrate.

TokenR1ng

TokenR1ng commented on Jan 6, 2025

@TokenR1ng

As stated in another issue, our project needs this feature in the @angular-devkit/build-angular:browser as well. Our project currently cannot migrate to the recommended application builder (which has this flag) and this small extension would really be helpful so that we can at least stay up-to-date with Angular versions. We need the stylePreprocessorOptions#sass option to suppress a lot of warnings comming from Bootstrap. Bootstrap itself will probably never fix this.

Squixx

Squixx commented on Jan 7, 2025

@Squixx

As stated in another issue, our project needs this feature in the @angular-devkit/build-angular:browser as well. Our project currently cannot migrate to the recommended application builder (which has this flag) and this small extension would really be helpful so that we can at least stay up-to-date with Angular versions. We need the stylePreprocessorOptions#sass option to suppress a lot of warnings comming from Bootstrap. Bootstrap itself will probably never fix this.

the same is true for @angular-devkit/build-angular:browser-esbuild & even for @angular-devkit/build-angular:ng-packagr which means a lot of log spam when building multiple packages

2 remaining items

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Karma builder: support `sass` in `stylePreprocessorOptions` with "builderMode: application" · Issue #29185 · angular/angular-cli