作为编辑说明,我确实更改了我的sass文件,以便触发'css'任务来更新我的样式。我仍然遇到同样的问题,它在运行默认任务后被卡住并且没有启动'css'。
var gulp = require('gulp');
var minifycss = require('gulp-cssnano');
var autoprefixer = require('gulp-autoprefixer');
var notify = require('gulp-notify');
var sass = require('gulp-ruby-sass');
var concat = require('gulp-concat');
var sourcemaps = require('gulp-sourcemaps');
gulp.task('css', function() {
return sass('sass/**/*.scss')
.pipe(sourcemaps.init())
.pipe(autoprefixer())
.pipe(concat('styles.css'))
.on('error', sass.logError)
.pipe(sourcemaps.write())
.pipe(gulp.dest('./css'))
.pipe(notify({ message: 'Wait for it....wait for it!!!' }));
});
gulp.task('default', function() {
gulp.watch('scss/**/*.scss',['css']);
});