2015-10-13 64 views
1

它有自己的舊版本工作"gulp-ruby-sass": "^0.7.1"吞氣插件一飲而盡,紅寶石薩斯不會在同一時間編譯器工作<code>"gulp-ruby-sass": "^2.0.4"</code>吞氣插件一飲而盡,紅寶石薩斯版本2.0.4不編譯

var gulp = require('gulp'), 
    sass = require('gulp-ruby-sass'), 
    notify = require("gulp-notify"), 
    bower = require('gulp-bower'); 
var config = { 
    sassPath: './resources/sass', 
    bowerDir: './bower_components' 
}; 

gulp.task('css', function() { 
    return gulp.src(config.sassPath + '/style.scss') 
     .pipe(sass({ 
     loadPath: [ 
      './resources/sass', 
     config.bowerDir + '/bootstrap-sass/assets/stylesheets', 
     config.bowerDir + '/font-awesome/scss', ] 
    }) 
    .on("error", notify.onError(function (error) { 
     return "Error: " + error.message; 
    }))) 
    .pipe(gulp.dest('./public/css')); 
}); 

enter image description here

回答

2

的代碼是爲老版本一飲而盡,紅寶石薩斯,需要另一種新版本2.0.4的編碼

gulp.task('css', function() { 
    return sass(config.sassPath + '/style.scss', { 
     precision: 6, 
     stopOnError: true, 
     cacheLocation: './', 
     loadPath: [ 
      './resources/sass', 
     config.bowerDir + '/bootstrap-sass/assets/stylesheets', 
     config.bowerDir + '/font-awesome/scss', ] 
    }) 
    .on("error", notify.onError(function (error) { 
     return "Error: " + error.message; 
    })) 
    .pipe(gulp.dest('./public/css')); 
});