gulp管不工作

时间:2018-05-06 00:00:32

标签: gulp gulp-sass

const gulp = require ('gulp');
const browserSync = require ('browser-sync').create();
const sass = require('gulp-sass');

//Compile Sass and inject into browser
gulp.task('sass', function(){
  return gulp.src(['node_modules/bootstrap/scss/bootstrap.scss','src/scss/*.scss']);
  .pipe(sass())
  .pipe(gulp.dest("src/css"))
  .pipe(browserSync.stream())
  });

.pipe正在抛出错误,我似乎无法让它发挥作用。这是它抛出的错误的快照

enter image description here

1 个答案:

答案 0 :(得分:1)

此行末尾有分号:

return gulp.src(['node_modules/bootstrap/scss/bootstrap.scss', 'src/scss/*.scss']);
___________________________________________________________________________ HERE ☝

您应将其删除,以便在Stream返回的gulp.src上致电.pipe

return gulp.src(['node_modules/bootstrap/scss/bootstrap.scss', 'src/scss/*.scss'])
    .pipe(sass())
    .pipe(gulp.dest("src/css"))
    .pipe(browserSync.stream())