-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gulpfile.js
76 lines (64 loc) · 1.83 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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
'use strict';
var gulp = require('gulp'),
paths = require('compass-options').paths(),
browserSync = require('browser-sync'),
shell = require('gulp-shell');
//////////////////////////////
// Begin Gulp Tasks
//////////////////////////////
require('./tasks/jshint')(gulp);
require('./tasks/dev-css')(gulp);
require('./tasks/dev-img')(gulp);
require('./tasks/dev-fonts')(gulp);
require('./tasks/dev-html')(gulp);
//////////////////////////////
// Compass Task
//////////////////////////////
gulp.task('compass', function () {
return gulp.src(paths.sass + '/**/*')
.pipe(shell([
'bundle exec compass watch --time'
]));
});
//////////////////////////////
// Watch
//////////////////////////////
gulp.task('watch-js', function () {
return gulp.watch(paths.js + '/**/*.js', ['jshint']);
});
gulp.task('watch-css', function () {
return gulp.watch(paths.css + '/**/*.css', ['dev-css']);
});
gulp.task('watch-img', function () {
return gulp.watch(paths.img + '/**/*', ['dev-img']);
});
gulp.task('watch-fonts', function () {
return gulp.watch(paths.fonts + '/**/*', ['dev-fonts']);
});
gulp.task('watch-html', function () {
return gulp.watch([
paths.html + '/**/*.html',
'!node_modules/**/*.html',
'!bower_components/**/*.html'
], ['dev-html']);
});
gulp.task('watch', ['watch-js', 'watch-css', 'watch-img', 'watch-fonts', 'watch-html']);
//////////////////////////////
// BrowserSync Task
//////////////////////////////
gulp.task('browserSync', function () {
return browserSync({
server: {
baseDir: paths.html
}
});
});
//////////////////////////////
// Server Tasks
//////////////////////////////
gulp.task('server', ['watch', 'compass', 'browserSync']);
gulp.task('serve', ['server']);
//////////////////////////////
// Default Task
//////////////////////////////
gulp.task('default', ['server']);