-
Notifications
You must be signed in to change notification settings - Fork 1
/
gulpfile.js
61 lines (50 loc) · 1.34 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
var gulp = require('gulp');
var csslint = require('gulp-csslint');
var jshint = require('gulp-jshint');
var jsonlint = require('gulp-json-lint');
var mainBowerFiles = require('main-bower-files');
var minifyCSS = require('gulp-minify-css');
var rename = require('gulp-rename');
var uglify = require('gulp-uglify');
gulp.task('bower-files', function() {
return gulp.src(mainBowerFiles({
includeDev: true
}))
.pipe(gulp.dest('./dist/js'));
});
gulp.task('uglify', function() {
gulp.src('./src/*.js')
.pipe(uglify())
.pipe(rename('jquery.autotabs.min.js'))
.pipe(gulp.dest('dist/js'))
});
gulp.task('jshint', function() {
gulp.src('./src/*.js')
.pipe(jshint())
.pipe(jshint.reporter('default'))
});
gulp.task('jsonlint', function() {
gulp.src('./*.json')
.pipe(jsonlint())
.pipe(jsonlint.report('verbose'));
});
gulp.task('csslint', function() {
gulp.src('./css/*.css')
.pipe(csslint())
.pipe(csslint.reporter());
});
gulp.task('minify-css', function() {
gulp.src('./css/*.css')
.pipe(minifyCSS({keepBreaks:true}))
.pipe(rename({
'suffix' : '.min'
}))
.pipe(gulp.dest('./dist/css'))
});
gulp.task('build', function() {
gulp.src('./src/jquery.autotabs.js')
.pipe(gulp.dest('./dist/js'));
gulp.src('./css/*.css')
.pipe(gulp.dest('./dist/css'));
});
gulp.task('default', ['uglify', 'minify-css', 'bower-files', 'build']);