Skip to content

Instantly share code, notes, and snippets.

@misscs
Created March 1, 2015 20:51
Show Gist options
  • Save misscs/730e024938a371b7b369 to your computer and use it in GitHub Desktop.
Save misscs/730e024938a371b7b369 to your computer and use it in GitHub Desktop.
Bower tasks for gulp
var bower = require('bower');
var bowerFiles = require('main-bower-files');
var del = require('del');
gulp.task('bower-clean-sass', function (cb) {
del(['assets/stylesheets/plugins/bower'], cb);
});
gulp.task('bower-clean', ['bower-clean-sass']);
gulp.task('bower-install', function (cb) {
bower.commands.install([])
.on('end', function () {
cb();
});
});
gulp.task('bower-sass', ['bower-clean-sass', 'bower-install'], function () {
return gulp.src(bowerFiles({
includeDev: true,
filter: ['**/*.scss', '**/*.css'],
}), {base: 'bower_components'})
.pipe(gulp.dest('assets/stylesheets/plugins/bower'));
});
gulp.task('bower', ['bower-sass']);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment