forked from jseppi/angular-dropdowns
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
45 lines (37 loc) · 1005 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
41
42
43
44
45
'use strict';
var gulp = require('gulp');
var uglify = require('gulp-uglify');
var rimraf = require('gulp-rimraf');
var jshint = require('gulp-jshint');
var rename = require('gulp-rename');
var stylish = require('jshint-stylish');
var srcFile = 'angular-dropdowns.js';
var srcCss = 'angular-dropdowns.css';
var distDir = './dist';
gulp.task('default', ['jshint', 'copy', 'uglify']);
gulp.task('dev', ['default'], function () {
return gulp.watch([srcFile, srcCss], ['default']);
});
gulp.task('jshint', function () {
return gulp.src(srcFile)
.pipe(jshint())
.pipe(jshint.reporter(stylish));
});
gulp.task('copy', function () {
return gulp.src([srcFile, srcCss])
.pipe(gulp.dest(distDir));
});
gulp.task('uglify', function () {
return gulp.src(srcFile)
.pipe(uglify({
preserveComments: 'some'
}))
.pipe(rename({
suffix: '.min'
}))
.pipe(gulp.dest(distDir));
});
gulp.task('clean', function () {
return gulp.src(distDir)
.pipe(rimraf());
});