Gulpjs combine two tasks into a single task

后端 未结 11 1160
攒了一身酷
攒了一身酷 2020-12-24 01:56

I currently have two tasks, that both compile sass files. I would still like to concat the two directories into separate files but it seems that it would be more maintainabl

11条回答
  •  自闭症患者
    2020-12-24 02:26

    Turns out that the site() function was returning an error. In order to fix it, I needed to make sure bootstrap() ran first so I ended up with this:

    // Compile Our Sass
    gulp.task('sass', function() {
      var bootstrap = function() {
        return gulp
          .src('./public/bower/bootstrap-sass/lib/*.scss')
          .pipe(sass())
          .pipe(concat('bootstrap.css'))
          .pipe(gulp.dest('./public/dist/css'));
      };
    
      var site = function() {
        return gulp
          .src('./public/src/scss/*.scss')
          .pipe(sass())
          .pipe(concat('site.css'))
          .pipe(gulp.dest('./public/dist/css'));
      };
    
      return bootstrap().on('end', site);
    });
    

提交回复
热议问题