-
Notifications
You must be signed in to change notification settings - Fork 29
/
gulpfile.js
40 lines (35 loc) · 1.15 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
(function() {
'use strict';
var gulp = require('gulp'),
concat = require('gulp-concat'),
uglify = require('gulp-uglify'),
ngmin = require('gulp-ngmin'),
jshint = require('gulp-jshint'),
livereload = require('gulp-livereload'),
jshint = require('gulp-jshint'),
stylish = require('jshint-stylish');
gulp.task('scripts', function() {
return gulp.src(['src/angular-mapbox.module.js', 'src/**/*.js'])
.pipe(concat('angular-mapbox.js'))
.pipe(gulp.dest('dist'));
});
gulp.task('build', function() {
return gulp.src(['src/angular-mapbox.module.js', 'src/**/*.js'])
.pipe(concat('angular-mapbox.min.js'))
.pipe(ngmin())
.pipe(uglify({ mangle: false }))
.pipe(gulp.dest('dist'));
});
gulp.task('watch', ['scripts'], function() {
var server = livereload();
gulp.watch('src/**/*.js', ['scripts']);
gulp.watch('dist/**').on('change', function(file) {
server.changed(file.path);
});
});
gulp.task('jshint', function () {
return gulp.src('src/**/*.js')
.pipe(jshint())
.pipe(jshint.reporter(stylish));
});
})();