9

I have an Angular 11 library using Bootstrap 4.5
ng-packagr uses SASS 1.34 which yields a lot of warning about the deprecation of the division operator, which is used a lot in Bootstrap (https://sass-lang.com/documentation/breaking-changes/slash-div)

The warning in question:

DEPRECATION WARNING: Using / for division is deprecated and will be removed in Dart Sass 2.0.0.

There is an option : --quiet-deps that can be used when manually executing sass, to hide these warnings.

My question is, how and where to pass this option when building the Angular library ?
It didn't find any possible configuration for the ng build command or in the ng-package.json file

Mistic
  • 1,377
  • 2
  • 13
  • 27
  • Please include an example of the warning in your post for searchability purposes. Is this [github issue](https://github.com/twbs/bootstrap/issues/34051)? Seems sass don't like supporting suppression of warnings [github comment](https://github.com/sass/libsass/issues/2822#issuecomment-482914373) and bootstrap may fix this pretty [soon](https://github.com/twbs/bootstrap/issues/34051#issuecomment-853613435) so the solution may end up being update to v5.1.0 when this comes along – Andrew Allen Jun 04 '21 at 14:52
  • 2
    Edited to add the warning. I know Bootstrap 5 will fix the issue, but it is not a solution, a lot of plugins are not yet compatible with v5. As I said there are options to mute sass (quietDeps and quiet) I just don't know how to pass them trough the Angular build chain. – Mistic Jun 05 '21 at 15:12
  • The Node API of Dart SASS does not expose the quietDeps options at all.... https://github.com/sass/sass/issues/3065 – Mistic Jun 07 '21 at 09:34
  • 1
    Doesn't directly solves your issue, but this worked for me: https://stackoverflow.com/a/62956076/2445933 – Andrew Shustariov Jun 25 '21 at 20:02
  • @AndrewShustariov thanks, using yarn this works natively `"resolutions": { "**/ng-packagr/sass": "~1.32.13" }` – Mistic Jun 28 '21 at 13:12

1 Answers1

3

As far as the CLI release notes for 12.1.2 go this feature was added as a fix for this issue. By simply omitting --verbose from your build command should result in no warnings.

(Run npm list -g @angular/cli and npm list @angular-devkit/build-angular to see the versions you are using.)

gwest7
  • 1,556
  • 19
  • 26