@import not working with sassc/scssc processor for gem libraries
The @import directive is not working if I try to load a stylesheet from a gem using the sassc/scssc processor:
application.scss:
@import 'bootstrap';
asset_pipeline.rb:
Sprockets::Helpers.configure do |config|
require 'sprockets/sassc_processor'
assets.register_transformer 'text/scss', 'text/css', Sprockets::ScsscProcessor.new
I get this error:
Error: File to import not found or unreadable: bootstrap
If I just leave the default processor, it works. On the other hand, I found a workaround to make it work by setting an additional asset_path:
assets.append_path(File.join(Gem::Specification.find_by_name('bootstrap-sass').gem_dir, 'assets/stylesheets')
I'm currently working on sassc support. There's some bugs. Right now i'm trying to get sassc-rails working with sprockets 4 https://github.com/sass/sassc-rails/pull/65 after that i'm looking to get the SasscProcessor working and then hopefully get sass-rails to auto default to sassc when it's present and Sprockets 4 is being used. I don't have a timeline for those fixes but that's the gameplan.
I never fixed sassc, i think it's not going to ship with sprockets 4. No clue what's wrong. In the mean time you can use the sassc-rails gem.