-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
40 lines (33 loc) · 1004 Bytes
/
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
var gulp = require('gulp');
var jshint = require('gulp-jshint'),
concat = require('gulp-concat'),
uglify = require('gulp-uglify'),
rename = require('gulp-rename'),
connect = require('gulp-connect'),
express = require('express');
gulp.task('lint', function() {
return gulp.src('js/*.js')
.pipe(jshint())
.pipe(jshint.reporter('default'));
});
gulp.task('scripts', function() {
return gulp.src('js/*.js')
.pipe(concat('all.js'))
.pipe(gulp.dest('dist'))
.pipe(rename('all.min.js'))
.pipe(uglify())
.pipe(gulp.dest('dist'));
});
gulp.task('watch', function() {
gulp.watch('js/*.js', ['lint', 'scripts']);
});
// For development, but express will handle this in prod.
gulp.task('serve', function() {
connect.server();
});
// Default Task
gulp.task('default', ['lint', 'scripts', 'serve', 'watch']);
// I run on deploy!
// gulp.task('heroku:production', function() {
// console.log('starting up!');
// });