-
Notifications
You must be signed in to change notification settings - Fork 34
/
gulpfile.js
49 lines (41 loc) · 1.24 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
'use strict';
var gulp = require('gulp');
var clean = require('gulp-clean');
var rename = require('gulp-rename');
var jshint = require('gulp-jshint');
var template = require('gulp-template');
var concat = require('gulp-concat');
var qunit = require('gulp-qunit');
var uglify = require('gulp-uglify');
var bump = require('gulp-bump');
var notify = require('gulp-notify');
var pkg = require('./package.json');
gulp.task('clean', function () {
return gulp.src('dist/', {read: false})
.pipe(clean());
});
gulp.task('test', function () {
gulp.src('test/slinky.html')
.pipe(qunit());
});
gulp.task('build', ['clean'], function (){
return gulp.src('src/*.js')
.pipe(jshint('src/.jshintrc'))
.pipe(jshint.reporter('default'))
.pipe(template(pkg))
.pipe(concat('jquery.slinky.js'))
.pipe(gulp.dest('dist'))
.pipe(rename('jquery.slinky.min.js'))
.pipe(uglify())
.pipe(gulp.dest('dist'))
.pipe(notify({ message: 'Slinky build was successful!' }));
});
gulp.task('bump', function () {
gulp.src(['./bower.json', './package.json', './slinky.jquery.json'])
.pipe(bump())
.pipe(gulp.dest('./'));
});
gulp.task('watch', function () {
gulp.watch('src/*.js', ['default']);
});
gulp.task('default', ['build', 'test']);