-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathGulpfile.js
More file actions
44 lines (38 loc) · 1.14 KB
/
Gulpfile.js
File metadata and controls
44 lines (38 loc) · 1.14 KB
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
var gulp = require('gulp');
var sass = require('gulp-sass');
var jshint = require('gulp-jshint');
var mocha = require('gulp-mocha');
var concat = require('gulp-concat');
var del = require('del');
// Sets up sass
gulp.task('sass', function () {
return gulp.src('./client/assets/css/*.scss')
.pipe(sass().on('error', sass.logError))
.pipe(gulp.dest('./client/assets/css'));
});
gulp.task('sass:watch', function () {
gulp.watch('./client/assets/css/*.scss', ['sass']);
});
// Sets up jshint
gulp.task('lint', function() {
return gulp.src('./client/**/*.js')
.pipe(jshint())
.pipe(jshint.reporter('default'));
});
// Sets up Mocha for testing
gulp.task('test', function () {
return gulp.src('test.js', {read: false})
// gulp-mocha needs filepaths so you can't have any plugins before it
.pipe(mocha({reporter: 'nyan'}));
});
gulp.task('concat', function() {
del('client/dist')
.then(function () {
return gulp.src(['client/**/*.js', '!client/bower_components{,/**}'])
.pipe(concat('app.js'))
.pipe(gulp.dest('client/dist/'));
});
});
gulp.task('concat:watch', function () {
gulp.watch('client/**/*.js', ['concat']);
});