-
Notifications
You must be signed in to change notification settings - Fork 5
/
gulpfile.js
43 lines (34 loc) · 1.06 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
"use strict"
var gulp = require('gulp');
var browserSync = require('browser-sync').create();
var jslint = require('gulp-jslint');
var paths = {
js : ['app.js', 'src/**/*.js', 'config/*.js']
}
// process JS files and return the stream.
gulp.task('js', () => {
return gulp.src(paths.js)
});
// create a task that ensures the `js` task is complete before
// reloading browsers
gulp.task('js-watch', ['js'], (done) => {
browserSync.reload();
done();
});
// use default task to launch Browsersync and watch JS files
gulp.task('serve', ['js'], () => {
// Serve files from the root of this project
browserSync.init({
server: {
baseDir: "./"
}
});
// add browserSync.reload to the tasks array to make
// all browsers reload after tasks are complete.
gulp.watch(paths.js, ['js-watch']);
});
gulp.task('default', () => {
return gulp.src(['source.js'])
.pipe(jslint({ /* this object represents the JSLint directives being passed down */ }))
.pipe(jslint.reporter( 'my-reporter' ));
});