-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
executable file
·54 lines (49 loc) · 1.22 KB
/
gulpfile.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
var gulp = require('gulp');
var browserSync = require('browser-sync');
var reload = browserSync.reload;
var harp = require('harp');
var deploy = require('gulp-gh-pages');
var cp = require('child_process');
/**
* Serve the Harp Site from the src directory
*/
gulp.task('serve', function () {
harp.server('.', {
port: 9000
}, function () {
browserSync({
proxy: "localhost:9000",
open: false,
/* Hide the notification. It gets annoying */
notify: {
styles: ['opacity: 0', 'position: absolute']
}
});
/**
* Watch for changes
*/
gulp.watch("./**/*.{styl,sass,scss,less}", function () {
reload("style.css", {stream: true});
});
gulp.watch("./**/*.{ejs,jade,haml,json,md}", reload)
})
});
/**
* Build the Harp Site
*/
gulp.task('build', function (done) {
cp.exec('harp compile . www', {stdio: 'inherit'})
.on('close', done)
});
/**
* Push build to gh-pages
*/
gulp.task('deploy', ['build'], function () {
return gulp.src("./www/**/*")
.pipe(deploy({branch: 'gh-pages'}))
});
/**
* Default task, running `gulp` will fire up the Harp site,
* launch BrowserSync & watch files.
*/
gulp.task('default', ['serve']);