Skip to content

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

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

Closed
cexbrayat opened this issue Dec 19, 2024 · 5 comments · Fixed by #29640
Closed
Labels
area: @angular-devkit/build-angular devkit/build-angular:karma feature Issue that requests a new feature freq1: low Only reported by a handful of users who observe it rarely

Comments

@cexbrayat
Copy link
Member

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

@alan-agius4
Copy link
Collaborator

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

@bst-celum
Copy link

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
Copy link

TokenR1ng commented Jan 6, 2025

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
Copy link

Squixx commented Jan 7, 2025

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

@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 Mar 21, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area: @angular-devkit/build-angular devkit/build-angular:karma feature Issue that requests a new feature freq1: low Only reported by a handful of users who observe it rarely
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants