Skip to content

Instantly share code, notes, and snippets.

@magician11 magician11/gulpfile.js
Last active Aug 29, 2015

Embed
What would you like to do?
Basic setup for Gulp with Sass, Bourbon, JSHint and a local webserver
// get gulp and the plugins we need for it
var gulp = require('gulp');
var scss = require('gulp-sass');
var bourbon = require('node-bourbon').includePaths;
var webserver = require('gulp-webserver');
var jshint = require('gulp-jshint');
// setup our Sass compilation task
gulp.task('scss', function() {
return gulp.src('styles/ag.scss')
.pipe(scss({
errLogToConsole: true,
includePaths: ['styles'].concat(bourbon)
}))
.pipe(gulp.dest('dist/css'));
});
// setup our webserver
gulp.task('webserver', function() {
gulp.src('.')
.pipe(webserver({
livereload: true,
open: true
}));
});
// quality check our JS
gulp.task('lint', function() {
return gulp.src('scripts/*.js')
.pipe(jshint())
.pipe(jshint.reporter('default'));
});
// watch our scss files for changes
gulp.task('watch', function() {
gulp.watch('styles/**/*.scss', ['scss']);
gulp.watch('scripts/*.js', ['lint']);
});
// run our tasks on running 'gulp' from the command line
gulp.task('default', ['webserver', 'watch']);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.