-
Notifications
You must be signed in to change notification settings - Fork 1
/
gulpfile.js
36 lines (30 loc) · 908 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
// Include gulp
var gulp = require('gulp');
// Include Our Plugins
var jshint = require('gulp-jshint');
var concat = require('gulp-concat');
var ngAnnotate = require('gulp-ng-annotate');
var uglify = require('gulp-uglify');
var rename = require('gulp-rename');
// Lint Task
gulp.task('lint', function() {
return gulp.src('src/**/*.js')
.pipe(jshint())
.pipe(jshint.reporter('default'));
});
// Concatenate & Minify JS
gulp.task('scripts', function() {
return gulp.src('src/**/*.js')
.pipe(concat('angular-graphael.js'))
.pipe(ngAnnotate())
.pipe(gulp.dest('./'))
.pipe(rename('angular-graphael.min.js'))
.pipe(uglify())
.pipe(gulp.dest('./'));
});
// Watch Files For Changes
gulp.task('watch', function() {
gulp.watch('src/**/*.js', ['lint', 'scripts']);
});
// Default Task
gulp.task('default', ['lint', 'scripts', 'watch']);