-
-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
Removal of sassc dependency #1235
Comments
AFAIK, this project does not support DartSass and is using sassc/LibSass (C++ one, not Ruby one). DartSass is very different from LibSass, don't expect this project to work properly with it. |
I realize that. It would be nice to not have the unneeded dependency since sassc is no longer maintained and it seems to be working fine for us. Changing to a newer version of bootstrap but that is a much bigger project |
Version 3.4.2 did break support for sassc/libsass by introducing |
Any update on this? - is there an alternative gem that doesn't use the deprecated sassc? |
@rgaufman I can confirm that switching from But if we try to switch to Reading through the code of this gem, it seems that |
I have the following setup: # Gemfile
gem "addressable"
gem "bcrypt"
gem "bootsnap", require: false
gem "coffee-rails"
gem "dartsass-ruby"
gem "dartsass-sprockets"
gem "mini_racer"
gem "rails", "~> 6.1"
gem "responders"
gem "sass"
gem "uglifier"
gem "ace-rails-ap", "~> 4.4"
gem "bootstrap-sass", "~> 3.4"
gem "bourbon"
gem "chosen-rails"
gem "ckeditor_rails"
gem "jquery-rails"
gem "jquery-ui-rails"
gem "select2-rails" Don't judge; I recently upgraded everything and haven't gotten around to dropping jQuery or upgrading Bootstrap. # config/assets.rb
Rails.application.config.assets.digest = true
Rails.application.config.assets.css_compressor = :sassc Using liquid and such, I had to update my importer: # app/utils/sass_importer.rb
class SassImporter < SassC::Importer
def initialize(options)
@options = options
@site_id = options[:site_id]
@syntax = options[:syntax]
@css_files = options[:css_files].to_a
end
def imports(path, parent_path)
parent_name = parent_path.split("/").last
return unless (template = find_template(path))
content = if template.tpl_ext == "sass"
SassC::Sass2Scss.convert(template.raw_content)
else
template.raw_content
end
SassC::Importer::Import.new(
path,
source: content,
)
end
private
attr_reader :site_id, :syntax, :css_files
def find_template(path)
css_files.find { |t| t.name == path }
end
end Now I had to change some imports etc during the upgrade but dartsass-ruby is working great for us with dartsass-sprockets. It isn't ideal and eventually, I'd love to kill all traces of sprockets. Unfortunately, dartsass-rails aren't very good yet. I tried it, and it fails to build, and it produced cryptic error messages. You would likely be better off using dartsass on the JS side then (yarn, bun, etc). |
Can the sassc dependency be removed?
We are using dartsass and would rather not have this as an explicit dependency
The text was updated successfully, but these errors were encountered: