forked from MehulATL/ng-Fx
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gulpfile.js
67 lines (56 loc) · 1.53 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
60
61
62
63
64
65
66
67
var gulp = require('gulp'),
concat = require('gulp-concat'),
notify = require('gulp-notify'),
min = require('gulp-ngmin'),
uglify = require('gulp-uglify'),
jshint = require('gulp-jshint');
var paths = {
animations: [
'./src/animationsAssist.js',
'./src/animationClass.js',
'./src/animations/*.js',
'./src/domAnimations/*.js',
'./src/directives/*.js',
'./src/animate.js'
],
dist: './dist/'
};
gulp.task('lint', function(){
return gulp.src(paths.animations)
.pipe(jshint({
globals: {
'TweenMax': true,
'TimelineMax': true,
'angular': true
}
}))
.pipe(jshint.reporter('jshint-stylish'))
.pipe(notify({message: 'Linting done'}));
});
gulp.task('concat', function(){
return gulp.src(paths.animations)
.pipe(concat('ng-Fx.js'))
.pipe(gulp.dest(paths.dist));
});
gulp.task('minify', function(){
return gulp.src(paths.animations)
.pipe(concat('ng-Fx.min.js'))
.pipe(gulp.dest(paths.dist));
});
gulp.task('preMin', ['minify'],function(){
return gulp.src('./dist/ng-Fx.min.js')
.pipe(min())
.pipe(gulp.dest(paths.dist))
.pipe(notify({message: 'Min done'}));
});
gulp.task('uglify', ['preMin'],function(){
return gulp.src('./dist/ng-fx.min.js')
.pipe(uglify())
.pipe(gulp.dest(paths.dist))
.pipe(notify({message: 'Build Done'}));
});
gulp.task('build', ['lint', 'concat','uglify']);
gulp.task('watch', function(){
gulp.watch(paths.animations, ['build']);
});
gulp.task('default', ['build' ,'watch']);