-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathgulpfile.js
46 lines (35 loc) · 1.21 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
var gulp = require('gulp'),
jshint = require('gulp-jshint'),
autoprefixer = require('gulp-autoprefixer'),
mocha = require('gulp-mocha'),
browserSync = require('browser-sync').create();
gulp.task('jshint', function () {
return gulp.src(['./client/js/**/*.js', './server/js/**/*.js'])
.pipe(jshint())
.pipe(jshint.reporter('jshint-stylish'));
});
gulp.task('css-autoprefixer', function () {
return gulp.src('./client/css/**/*.css', {
base: './'
})
.pipe(autoprefixer({
browsers: ['last 2 versions']
}))
.pipe(gulp.dest('./'));
});
gulp.task('watch', ['browserSync', 'jshint', 'mocha'], function () {
gulp.watch(['./client/js/**/*.js', './server/js/**/*.js'], ['jshint']);
gulp.watch(['./client/**/*.html', './client/js/**/*.js', './client/css/**/*.css'], browserSync.reload);
gulp.watch('./server/**/*.js', ['mocha']);
});
gulp.task('browserSync', function () {
browserSync.init({
proxy: "localhost:8080"
});
});
gulp.task('mocha', function () {
gulp.watch('./server/**/*.js', ['mocha']);
return gulp.src('./server/test/**/*.test.js')
.pipe(mocha());
});
gulp.task('default', ['watch']);