-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgulpfile.js
More file actions
45 lines (38 loc) · 1.06 KB
/
gulpfile.js
File metadata and controls
45 lines (38 loc) · 1.06 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
45
'use strict';
var gulp = require('gulp');
// Include Our Plugins
var jshint = require('gulp-jshint');
var concat = require('gulp-concat');
var uglify = require('gulp-uglify');
var rename = require('gulp-rename');
var nodemon = require('nodemon');
// Lint Task
gulp.task('lint', function () {
return gulp.src('*.js')
.pipe(jshint())
.pipe(jshint.reporter('default'));
});
// Concatenate & Minify JS
gulp.task('scripts', function () {
return gulp.src(['public/app/*.js', 'public/app/**/*.js'])
.pipe(concat('app.js'))
.pipe(gulp.dest('public/dist'))
.pipe(rename('app.min.js'))
.pipe(uglify())
.pipe(gulp.dest('public/dist'));
});
// Watch for changes and reboot if needed
gulp.task('watch', function () {
nodemon({
script: 'server.js',
ext: 'html js',
ignore: [
'public/dist/*.js'
]
})
.on('restart', function () {
console.log('The Matrix is reloading.');
});
});
// Default Task
gulp.task('default', ['lint', 'scripts', 'watch']);