forked from CunningCoders/Relocalc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
59 lines (51 loc) · 1.29 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
var gulp = require('gulp');
//var gutil = require('gulp-util');
var nodemon = require('gulp-nodemon');
var concat = require('gulp-concat');
var sass = require('gulp-sass');
var watch = require('gulp-watch');
var jshint = require('gulp-jshint');
var uglify = require('gulp-uglify')
var stylish = require('jshint-stylish');
/**
* nodemon to keep the server going and run tasks
*/
gulp.task('start', function () {
nodemon({ script: './server/index.js',
ext: 'html js css',
tasks: ['lint', 'sass'],
})
.on('restart', function () {
console.log('restarted!')
})
})
/*
minimize data files
*/
gulp.task('uglify', function (){
gulp.src('./server/data/*.js')
.pipe(uglify())
.pipe(gulp.dest('./server/data/'))
});
/**
* compiles sass files into css
*/
gulp.task('sass', function () {
gulp.src('./client/public/sass/*.scss')
.pipe(sass().on('error', sass.logError))
.pipe(concat('style.css'))
.pipe(gulp.dest('./client/public/'));
});
/**
* logs jshint warnings
*/
gulp.task('lint', function() {
return gulp.src(['client/**/**/*', 'server/*'])
.pipe(jshint('.jshintrc'))
.pipe(jshint.reporter(stylish));
});
gulp.task('test', ['lint']);
gulp.task('default', ['lint', 'sass']);
gulp.task('watch', function () {
gulp.watch('./sass/**/*.scss', ['sass']);
});