-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
54 lines (47 loc) · 1.38 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 w3cjs = require('gulp-w3cjs');
var csslint = require('gulp-csslint');
var jshint = require('gulp-jshint');
var stylish = require('jshint-stylish');
var browserSync = require('browser-sync');
var reload = browserSync.reload;
gulp.task('htmllint', function () {
gulp.src('*.html')
.pipe(w3cjs());
});
gulp.task('jshint', function () {
gulp.src(['*.js', 'public/js/**/*.js'])
.pipe(jshint())
.pipe(jshint.reporter());
});
gulp.task('csslint', function() {
gulp.src('css/*.css')
.pipe(csslint())
.pipe(csslint.reporter());
});
gulp.task('lint', function() {
return gulp.src('./lib/*.js')
.pipe(jshint())
.pipe(jshint.reporter('jshint-stylish'));
});
// Watch Files For Changes & Reload
gulp.task('serve', function () {
browserSync({
notify: false,
// Customize the BrowserSync console logging prefix
logPrefix: 'WSK',
// Run as an https by uncommenting 'https: true'
// Note: this uses an unsigned certificate which on first access
// will present a certificate warning in the browser.
// https: true,
server: ['.tmp', '.']
});
gulp.watch(['*.html'], reload);
gulp.watch(['templates/**/*.html'], reload);
gulp.watch(['styles/**/*.{scss,css}'], reload);
gulp.watch(['js/**/*.js'], ['jshint']);
gulp.watch(['img/**/*'], reload);
});
gulp.task('default', function() {
gulp.start('htmllint', 'csslint');
});