-
Notifications
You must be signed in to change notification settings - Fork 121
/
gulpfile.js
64 lines (53 loc) · 1.44 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
'use strict';
var gulp = require('gulp');
var uglify = require('gulp-uglify');
var del = require('del');
var jshint = require('gulp-jshint');
var rename = require('gulp-rename');
var stylish = require('jshint-stylish');
var minifyCss = require('gulp-minify-css');
var ghPages = require('gulp-gh-pages');
var srcFile = 'angular-dropdowns.js';
var srcCss = 'angular-dropdowns.css';
var distDir = './dist';
var exampleDir = './example';
gulp.task('default', ['jshint', 'copy', 'uglify', 'minifycss']);
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('minifycss', function () {
return gulp.src([srcCss])
.pipe(minifyCss({
compatibility: 'ie8'
}))
.pipe(rename({
suffix: '.min'
}))
.pipe(gulp.dest(distDir));
});
gulp.task('pages', ['default'], function () {
return gulp.src(['index.html', distDir + '/**/*', exampleDir + '/**/*'], {"base": "."})
.pipe(ghPages());
});
gulp.task('clean', function () {
return del([distDir + '/*']);
});