farm-fe / farm

Extremely fast Vite-compatible web build tool written in Rust
https://farmfe.org
MIT License
4.37k stars 146 forks source link

[Bug Report]: quietDeps option for dart-sass isn't recognised #1423

Open Radiergummi opened 2 weeks ago

Radiergummi commented 2 weeks ago

Steps to reproduce

I'm trying to migrate an application from Vite to Farm. The project uses Vuetify 2, which relies heavily on deprecated implicit divisions; as Vuetify 2 is deprecated by now, there isn't much I can do about it (safe migrating to v3, which is underway, but lots of work).
This causes dart-sass to emit hundreds of deprecation warnings like this during the build:

   ╷
58 │ $container-padding-x: $grid-gutter / 2 !default;
   │                       ^^^^^^^^^^^^^^^^
   ╵
    node_modules/vuetify/src/styles/settings/_variables.scss 58:23     @import
    node_modules/vuetify/src/styles/settings/_index.sass 1:9           @import
    node_modules/vuetify/src/styles/styles.sass 2:9                    @import
    node_modules/vuetify/src/components/VSnackbar/_variables.scss 1:9  @import
    node_modules/vuetify/src/components/VSnackbar/VSnackbar.sass 1:9   root stylesheet

Deprecation Warning: Using / for division outside of calc() is deprecated and will be removed in Dart Sass 2.0.0.

Recommendation: math.div($grid-gutter, 12) or calc($grid-gutter / 12)

More info and automated migrator: https://sass-lang.com/d/slash-div

Now, as that sass-lang page mentions, there's the setting quietDeps to silence these warnings. Alas, this doesn't seem to work for Farm when configured as documented:

plugins: [
    [ '@farmfe/plugin-sass', { quietDeps: true, verbose: false } ],
],

I verified that options are passed by setting alertColor: true, which as expected made the deprecation warnings monochrome. I can't get it to omit the deprecations, though.

To reproduce:

  1. Import a sass stylesheet that uses implicit divisions, or produce another deprecation (5 / 2)
  2. Configure plugin-sass to silence deprecations (quietDeps: true)
  3. Build the application

Reproduce link

No response

What is actually happening?

Deprecations are logged.

System Info

System:
    OS: macOS 14.5
    CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
    Memory: 668.66 MB / 16.00 GB
    Shell: 3.7.1 - /usr/local/bin/fish
  Binaries:
    node: v22.2.0
    npm: 10.7.0
  Browsers:
    Chrome: 126.0.6478.114
    Safari: 17.5
  npmPackages:
    @farmfe/core: ^1.1.13 => 1.2.0
wre232114 commented 2 weeks ago

Rust sass plugin may not support all the sass options. You can try js-sass-plugin instead https://www.farmfe.org/docs/plugins/official-plugins/js-sass