From 406b25237e01e008339be260817cc5e775527acd Mon Sep 17 00:00:00 2001 From: Jukka Rautanen Date: Tue, 24 Sep 2024 08:30:43 +0300 Subject: [PATCH] Alter the config to pass a --quiet-deps flag --- README.md | 10 ++++++++++ lib/sassc/rails/railtie.rb | 3 +++ lib/sassc/rails/template.rb | 1 + 3 files changed, 14 insertions(+) diff --git a/README.md b/README.md index 0a9066f..b7d3d26 100644 --- a/README.md +++ b/README.md @@ -58,6 +58,16 @@ After adding this config line, you may need to clear your assets cache Note these source maps are *inline* and will be appended to the compiled `application.css` file. (They will *not* generate additional files.) +### Silencing Deprecation Warnings + +To silence deprecation warnings during compilation, add the following configuration +to your `application.rb` file: + +```ruby +# config/environments/development.rb +config.sass.quiet_deps = true +``` + ## Alternatives * [dartsass-rails](https://github.com/rails/dartsass-rails): The Rails organization diff --git a/lib/sassc/rails/railtie.rb b/lib/sassc/rails/railtie.rb index a366743..bc59542 100644 --- a/lib/sassc/rails/railtie.rb +++ b/lib/sassc/rails/railtie.rb @@ -18,6 +18,9 @@ class Railtie < ::Rails::Railtie # Display line comments above each selector as a debugging aid config.sass.line_comments = true + # Silence deprecation warnings during compilation + config.sass.quiet_deps = false + # Set the default stylesheet engine # It can be overridden by passing: # --stylesheet_engine=sass diff --git a/lib/sassc/rails/template.rb b/lib/sassc/rails/template.rb index 0f12568..d0a9449 100644 --- a/lib/sassc/rails/template.rb +++ b/lib/sassc/rails/template.rb @@ -30,6 +30,7 @@ def call(input) load_paths: input[:environment].paths, functions: @functions, importer: @importer_class, + quiet_deps: ::Rails.application.config.sass.quiet_deps, sprockets: { context: context, environment: input[:environment],