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正在抛出错误,我似乎无法让它发挥作用。这是它抛出的错误的快照
答案 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())