Gulp-sass 无法编译

Gulp-sass won't compile

希望有人能帮助我使用 gulp 编译我的 SCSS 文件。

除其他外,我一直在阅读有关此 (http://www.devworkflows.com/posts/getting-scss-auto-prefixer-and-source-map-to-play-nice/) and followed this stack overflow conversation (Gulp-sass will not compile to CSS) 的大量资料。我仍然无法使用我的 gulp 脚本编译我的 .scss

当我 运行 gulp sass 过程输出:

[16:25:32] Working directory changed to ~/projects/theBeta
[16:25:32] Using gulpfile ~/projects/theBeta/gulpfile.js
[16:25:32] Starting 'sass'...
[16:25:32] Finished 'sass' after 6.37 ms

但是没有输出文件。我已经能够使用此命令通过命令行使其工作 - sass scss/_bootstrap.scss:css/compiled/bootstrap.css

这是有问题的脚本:

// Compile sass
gulp.task('sass', function() {
  gulp.src('./app/styles/scss/_bootstrap.scss')
    .pipe(sass({sourcemap: true}))
    .on('error', sass.logError)
    .pipe(gulp.dest('./app/styles/css/compiled'));
})

我是否遗漏了什么微妙的东西,或者我不属于 understanding/aware 的行为?

gulp.src 前面添加 return 并将 _bootstrap.scss 重命名为 bootstrap.scss 因为它不是包含:

gulp.task('sass', function() {
  return gulp.src('./app/styles/scss/bootstrap.scss')
    .pipe(sass({sourcemap: true}))
    .on('error', sass.logError)
    .pipe(gulp.dest('./app/styles/css/compiled'));
})