-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
34 lines (29 loc) · 842 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
var gulp = require('gulp');
var csslint = require('gulp-csslint');
var jslint = require('gulp-jshint');
var uglify = require('gulp-uglify');
var minifyCSS = require('gulp-minify-css');
gulp.task("csslint", function () {
return gulp.src("src/css/*.css")
.pipe(csslint())
.pipe(csslint.reporter());
});
gulp.task("jslint", function () {
return gulp.src("src/js/*.js")
.pipe(jslint())
.pipe(jslint.reporter("default"));
});
gulp.task('compress-css', function () {
gulp.src('src/css/*.css')
.pipe(minifyCSS({
keepBreaks: true
}))
.pipe(gulp.dest('build/css'))
});
gulp.task("compress-js", function () {
gulp.src('src/js/*.js')
.pipe(uglify())
.pipe(gulp.dest('build/js'))
})
gulp.task('default', ['jslint', 'csslint'])
gulp.task('build', ['jslint', 'csslint', 'compress-js', 'compress-css'])