My gulpfile.js
var gulp = require('gulp'); // plugins var sass = require('gulp-sass'); var minifycss = require('gulp-minify-css'); // compile sass gulp.task('sass', function() { return gulp.src('static/css/scss/main.scss') .pipe(sass()) .pipe(minifycss()) .pipe(gulp.dest('/static/css/main.css')); }); gulp.task('watch', function() { gulp.watch('static/css/scss/*.scss', ['sass']); }) gulp.task('default', ['watch']);
When I run gulp , I get the following output:
[gulp] Using gulpfile /var/www/example/gulpfile.js [gulp] Starting 'watch'... [gulp] Finished 'watch' after 21 ms [gulp] Starting 'default'... [gulp] Finished 'default' after 23 Ξs
Then, when I save the main.scss file, it outputs:
[gulp] Starting 'sass'...
At this moment, it just hangs and never ends. What am I doing wrong?
sass gulp
xylar
source share