0

I'm using gulp-compass to compile scss files. However, I'm concatenating output into a single file.

This all works fine, but I'm noticing that compass itself is writing the individual files to the output directory.

I'm left with the individual files, as well as the concatenated result.

Is there any way to prevent that intermediate output?

gulp.task('compass:dev', function() {
    return gulp.src(appPath + '/**/*.scss')
        .pipe(plugins.compass({
            css: distPath + '/css',
            sass: appPath
        }))
        .pipe(plugins.concat('app.css'))
        .pipe(gulp.dest(distPath + '/css'));
});
helion3
  • 34,737
  • 15
  • 57
  • 100
  • Do you have any Compass dependencies that you really, really need? `gulp-compass` has been blacklisted by the Gulp developers for violating against some "plugin rules" which have been established (like your aforementioned intermediate save). We could think of dropping `gulp-compass` in favour of another one – ddprrt May 13 '15 at 19:57

1 Answers1

0

As mentioned before, gulp-compass has been blacklisted by the Gulp developers for violating against some "plugin rules" which have been established (for instance: you have to redefine input and output). Which means that you really, really shouldn't use it. However, gulp-ruby-sass as an option for allowing you to use compass imports. Consider this:

var sass = require('gulp-ruby-sass');

gulp.task('compass:dev', function() {
    return sass(appPath + '/**/*.scss', { compass: true})
        .pipe(plugins.concat('app.css'))
        .pipe(gulp.dest(distPath + '/css'));
});

Depending on your setup, there still might be breaks.

ddprrt
  • 7,424
  • 3
  • 29
  • 25
  • I wasn't aware gulp-compass had those issues but it seems obvious in hindsight. This fixes the issue. – helion3 May 14 '15 at 02:08