Created
March 1, 2015 20:40
-
-
Save misscs/ad6ce163beabcf9330df to your computer and use it in GitHub Desktop.
[WIP] The gulp file I keep turning to. Darling, I only have eyes for you.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var gulp = require('gulp'); | |
var browserSync = require('browser-sync'); | |
var reload = browserSync.reload; | |
var harp = require('harp'); | |
var scsslint = require('gulp-scss-lint'); | |
var cache = require('gulp-cached'); | |
var paths = { | |
templates: '**/*.{jade, md}', | |
css: 'assets/stylesheets/*.css', | |
sass: ['assets/stylesheets/**/*.scss', 'assets/stylesheets/*.scss'], | |
images: 'assets/stylesheets/img/**/*', | |
js: 'assets/js/**/*.js', | |
fonts: 'assets/fonts/**/*', | |
}; | |
/** | |
* Serve the Harp Site root directory | |
*/ | |
gulp.task('serve', function () { | |
harp.server(__dirname, { | |
port: 9000 | |
}, function () { | |
browserSync({ | |
proxy: "localhost:9000", | |
open: false, | |
ghostMode: { | |
clicks: true, | |
forms: false, | |
scroll: true | |
}, | |
logLevel: "debug", | |
logPrefix: 'GothamSass', | |
notify: false | |
}); | |
/** | |
* Watch for scss changes, tell BrowserSync to refresh css | |
*/ | |
gulp.watch(paths.sass, ['lint',reload]); | |
gulp.watch(paths.templates, reload); | |
gulp.watch(paths.images, reload); | |
gulp.watch(paths.js, reload) | |
}) | |
}); | |
/** | |
* Lint files | |
*/ | |
gulp.task('lint', function() { | |
gulp.src(paths.sass) | |
.pipe(cache('scsslint')) | |
.pipe(scsslint({'config': 'lint.yml',})) | |
.pipe(reload({stream: true})); | |
}); | |
/** | |
* Default task, running just `gulp` will compile the sass, | |
* compile the harp site, launch BrowserSync & watch files. | |
*/ | |
gulp.task('default', ['serve', 'lint']); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment