0

I've updated from "gulp-compass": "^2.0.3" to "gulp-compass": "^2.1.0" and now looks like gulp-changed gives me an error

app/node_modules/gulp-changed/index.js:31
            if (sourceFile.stat.mtime > targetStat.mtime) {
                               ^
TypeError: Cannot read property 'mtime' of null
app/node_modules/gulp-changed/index.js:31:23
    at Object.oncomplete (fs.js:108:15)

My gulp task

gulp.task('sass-desktop', function () {
    return gulp.src('scss/*.scss')
        .pipe(plumber({
            errorHandler: function (error) {
                console.log(error.message);
                this.emit('end');
            }}))
        .pipe(compass({
            config_file: 'config.rb',
            css: 'css',
            sass: 'scss',
            image: 'images',
            debug: false,
            require: ['susy', 'modular-scale']
        }))
        .on('error', function(error) {
            // Would like to catch the error here
            console.log(error);
            this.emit('end');
        })
        .pipe(autoprefixer({
            browsers: ['last 8 versions'],
            cascade: false
        }))
        .pipe(changed('css', {extension: '.css'}))
        .pipe(gulp.dest('css'))
});

I've added a comment when somebody opened a bug on gulp-changed, but looks like this won't work with ruby sass: https://github.com/sindresorhus/gulp-changed/issues/25#issuecomment-108256528

Any alternatives to this plugin you know of?

Adrian Florescu
  • 4,454
  • 8
  • 50
  • 74

2 Answers2

0

I don't really use these two gulp modules and just walk through and see this.

You can refer to this question about the comparison between gulp-changed and gulp-newer: gulp-newer vs gulp-changed

Hope that its helpful :)

Community
  • 1
  • 1
eriknguyen
  • 520
  • 4
  • 13
0

There's a couple of alternatives to Ruby Sass (it's given me a bunch of errors in the past). You have to factor in with Ruby sass that you're dealing with versioning Ruby on your machine and then on the particular project directory as well. There can be a lot of conflict errors.

A popular option is node-sass which actually uses C.

I believe the best option however is to use gulp-scss which natively uses node to compile your sass leading to the lowest amount of conflict errors between languages.

SteveB
  • 155
  • 1
  • 9