Search code examples
rubysassgruntjscompasslibsass

How to use compass on Grunt with libsass instead of ruby sass?


We've been using the Ruby version of the sass compiler with compass and grunt-contrib-sass for quite a while but it's very slow.

Since libsass is faster than its Ruby pendant, we replaced grunt-contrib-sass with grunt-sass.

Unfortunately, the docs for grunt-contrib-compass say:

This task requires you to have Ruby, Sass, and Compass >=1.0.1 installed

Also, when I run our build, I get:

Running "sass:dist" (sass) task
>> Error: File to import not found or unreadable: compass
>>        Parent style sheet: src/assets/sass/catalog.scss
>>         on line 15 of src/assets/sass/catalog.scss
>> >> @import "compass";
>>    ^
Warning:  Use --force to continue.

So, if grunt-contrib-compass is not compatible with grunt-sass how can I use compass with libsass then?


Solution

  • Found the solution. It was as easy as installing compass-importer:

    $ npm install --save-dev compass-importer
    

    And then set importer: compass in Gruntfile.js