Skip to content

@import not working with sassc/scssc processor for gem libraries #329

@dagi3d

Description

@dagi3d

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')

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions