tablecheck / dartsass-sprockets

Integrate Dart Sass with Sprockets (Ruby on Rails asset pipeline)
MIT License
35 stars 5 forks source link

Alter the config to pass a `--quiet-deps` flag #25

Open nimmolo opened 5 months ago

nimmolo commented 5 months ago

Our app has a ton of SCSS deprecation warnings.

Is there a way to pass the dart-sass build flag to quiet these? Something like how dartsass-rails has Rails.application.config.dartsass.build_options << " --quiet-deps"

nimmolo commented 5 months ago

Actually, groping in the dark here... I checked out the way config_options is passed in Sprockets::SassCompressor and SassTemplate so I tried just passing the arg like this, and it ~seems to have worked~.

# config/production.rb 
  config.sass.quiet_deps = true

~Would you be open to a PR to document this?~ Update, it does not work to pass the config. The deprecation warnings are reported unpredictably on compile (as far as I can tell), and I just thought it had silenced them. The gem actually doesn't handle these args, so i'm working on a PR to handle them.

johnnyshields commented 3 months ago

I'm happy to accept a PR for this.

nimmolo commented 3 months ago

I'm going to try to enable a config like this.

  # config/production.rb  
  config.sass.quiet_deps = true

It seems the config options for this gem are set in three different places though, and I'm a little confused by that. I assume this is for compatibility with SassC's API.

Should I focus on one of these instead of the others?