# Adding Compass to gulpfile.js

**URL:** https://discourse.roots.io/t/adding-compass-to-gulpfile-js/3210
**Category:** sage
**Tags:** gulp
**Created:** 2015-03-13T00:28:46Z
**Posts:** 11
**Showing post:** 2 of 11

## Post 2 by @austin — 2015-03-13T00:35:52Z

This should be what you need:

```
var cssTasks = function(filename) {
  return lazypipe()
    .pipe(function() {
      return $.if(!enabled.failStyleTask, $.plumber());
    })
    .pipe(function() {
      return $.if(enabled.maps, $.sourcemaps.init());
    })
      .pipe(function() {
        return $.if('*.less', $.less());
      })
      .pipe(function() {
        return $.if('*.scss', $.ruby-sass({
          precision: 10,
          compass: true
        }));
      })
      .pipe($.concat, filename)
      .pipe($.pleeease, {
        autoprefixer: {
          browsers: [
            'last 2 versions', 'ie 8', 'ie 9', 'android 2.3', 'android 4',
            'opera 12'
          ]
        }
      })
    .pipe(function() {
      return $.if(enabled.rev, $.rev());
    })
    .pipe(function() {
      return $.if(enabled.maps, $.sourcemaps.write('.'));
    })();
};
```

> <https://gist.github.com/austinpray/494b0b97c5b5e24f35eb/revisions>

This requires gulp-ruby-sass to be installed so `npm install --save gulp-ruby-sass`. You also have to bring your own config.rb and install compass on your machine.

---

_[View the full topic](https://discourse.roots.io/t/adding-compass-to-gulpfile-js/3210)._
