-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
43 lines (34 loc) · 1017 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
var gulp = require('gulp');
var jshint = require('gulp-jshint');
var stylish = require('jshint-stylish');
var uglify = require('gulp-uglify');
var prefix = require('gulp-autoprefixer');
var cssmin = require('gulp-minify-css');
var paths = {
js: 'src/hipbox.js',
css: 'src/hipbox.css',
dist: 'dist'
};
gulp.task('jshint', function () {
gulp.src(paths.js)
.pipe(jshint('.jshintrc'))
.pipe(jshint.reporter(stylish));
});
gulp.task('js', function () {
gulp.src(paths.js)
.pipe(uglify({ compress: true }))
.pipe(gulp.dest(paths.dist));
});
gulp.task('css', function () {
gulp.src(paths.css)
.pipe(prefix('last 10 version'))
.pipe(cssmin({ compatibility: 'ie8' }))
.pipe(gulp.dest(paths.dist));
});
gulp.task('watch', function () {
var files = [].concat(paths.js, paths.css);
gulp.watch(files, ['build']);
});
gulp.task('test', ['jshint']);
gulp.task('build', ['test', 'js', 'css']);
gulp.task('default', ['build', 'watch']);