2016-07-12 7 views
3

を提供する必要があります。私は私のワークステーションを設定一息-ルビーSASSエラー:これは私のディレクトリ構造であるパターン

Here

、と私は私のフォルダ形式で動作するように私のがぶ飲みファイルを設定し、それ正しく動作していません。

これは私のガルプファイルです:問題は何

(node:6668) fs: re-evaluating native module sources is not supported. If you are using the graceful-fs module, please update it to a more recent version. 
[08:42:23] Using gulpfile /var/www/html/evandro/sistema_metas/gulpfile.js 
[08:42:23] Starting 'sass'... 
[08:42:23] 'sass' errored after 7.09 ms 
[08:42:23] Error: must provide pattern 

var gulp  = require('gulp'), 
    sass  = require('gulp-ruby-sass'), 
    imagemin = require('gulp-imagemin'), 
    changed  = require('gulp-changed'), 
    browserSync = require('browser-sync'), 
    livereload = require('gulp-livereload'),  
    gp_concat = require('gulp-concat'), 
    gp_rename = require('gulp-rename'), 
    gp_uglify = require('gulp-uglify'), 
    watch = require('gulp-watch'); 


gulp.task('sass', function() { 
    gulp.src('./app/template/css/style_v1.scss') 
    .pipe(sass()) 
    .on('error', function (err) { console.log(err.message); }) 
    .pipe(gulp.dest('./dist/css')) 
    .pipe(livereload()); 
}); 

gulp.task('compress', function() { 
    gulp.src('./app/*.js') 
    .pipe(gp_concat('concat.js')) 
     .pipe(gulp.dest('dist')) 
     .pipe(gp_rename('script.min.js')) 
     .pipe(gp_uglify()) 
     .pipe(gulp.dest('./dist/js')); 
}); 

gulp.task('jpg', function() { 
    gulp.src('./template/img/**/*.*') 
     .pipe(changed('./dist/img/')) 
     .pipe(imagemin({ 
      progressive: true 
     })) 
     .pipe(gulp.dest('./dist/img/')); 
}); 

gulp.task('browser-sync', function() { 
    browserSync.init(['./dist/css/**', 'index.php'], { 
     server: { 
      baseDir: './', 
      index: 'index.php' 
     } 
    }); 
}); 

gulp.task('watch', ['sass', 'browser-sync','compress'], function() { 
    return watch('./app/template/css/style_v1.scss', function() { 
     gulp.src('./app/template/css/style_v1.scss') 
      .pipe(gulp.dest('build')); 
    }); 
}); 

私はgulp watchを実行すると、それはこれを返しますか?

私は別のコードを持っていますが、CSS Watchは動作せず、ただHTMLを見ています。それは何ですか?

答えて

3

gulp-ruby-sassは、他のgulpプラグインとは動作が異なります。あなたは.pipe()にそれを渡さないでください。あなたはthe documentationを見てみた場合には、次の言葉:

Use gulp-ruby-sass instead of gulp.src to compile Sass files.

あなたはこのようにそれを使用する必要が意味する:

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

gulp.task('sass', function() { 
    return sass('./app/template/css/style_v1.scss') 
    .on('error', function (err) { console.log(err.message); }) 
    .pipe(gulp.dest('./dist/css')) 
    .pipe(livereload()); 
}); 

またあなたの代わりにgulp-ruby-sassgulp-sassプラグインを使用することができます。 SASSのRuby実装ではなく、C実装(libsass)を使用しています。

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

gulp.task('sass', function() { 
    return gulp.src('./app/template/css/style_v1.scss') 
    .pipe(sass()) 
    .on('error', function (err) { console.log(err.message); }) 
    .pipe(gulp.dest('./dist/css')) 
    .pipe(livereload()); 
}); 
+0

おかげで、完全に働いた今、私はウォッチSASSを確認し、:それはあなたが正常に他のほとんどの一気のプラグインのと同じように、あなたが.pipe()を使用することができます。 – Shelon

関連する問題