1

I have this simple gulp task to process .scss files:

var gulp = require('gulp'),
    compass = require('gulp-compass'),
    autoprefixer = require('gulp-autoprefixer'),
    plumber = require('gulp-plumber'),
    browserSync = require('browser-sync'),
    reload = browserSync.reload;

gulp.task('css', function() {
    gulp.src('app/scss/style.scss')
        .pipe(plumber())
        .pipe(compass({
            config_file: './config.rb',
            css: 'app/css',
            sass: 'app/scss',
            require: ['susy', 'breakpoint']
        }))
        .pipe(autoprefixer('last 2 versions'))
        .pipe(gulp.dest('app/css'))
        .pipe(reload({
            stream: true
        }));
});

My problem is that when there is already an app/css/style.css, it won't be overridden by running task gulp css.

As per https://github.com/wearefractal/vinyl-fs#destfolder-opt, gulp.dest should by default override the files in the destination folder. And I have another gulp task for uglify js, the overriding in which works well.

Could someone give me some hint on why this is happening?

Hao Chang
  • 355
  • 2
  • 3
  • 12
  • You did everything right. The Problem here seems to be gulp-compass itself. Does the `config.rb` file exist in your project? – Rokie Aug 29 '15 at 11:20
  • Yes, it does. `require 'susy'` `require 'breakpoint'` `project_type = :stand_alone` `http_path = "/"` `sass_dir = "app/scss"` `css_dir = "app/css"` `images_dir = "app/images"` `fonts_dir = "app/fonts"` `javascript_dir = "app/js"` `line_comments = true` `preferred_syntax = :scss` `output_style = :compressed` `relative_assets = true` Actually, everything works except that `gulp` doesn't override the existent file in the destination folder. – Hao Chang Aug 29 '15 at 11:24
  • I have a similar setup except that I'll rather use `gulp-sass` instead of `gulp-compass` and everything works fine here. So the problem isn't `gulp.dest` for sure. Maybe this discussion gives you some hints on that http://stackoverflow.com/questions/27383740/gulp-compass-creates-an-unwanted-file-instead-of-using-only-stream – Rokie Aug 29 '15 at 11:36

0 Answers0