forked from wagerfield/parallax
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
43 lines (36 loc) · 1.05 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
var gulp = require('gulp'),
plugins = require("gulp-load-plugins")();
function build(stream, file) {
return stream
.pipe(plugins.jshint())
.pipe(plugins.jshint.reporter('jshint-stylish'))
.pipe(plugins.concat(file))
.pipe(gulp.dest('deploy'))
.pipe(plugins.rename({suffix: '.min'}))
.pipe(plugins.uglify())
.pipe(gulp.dest('deploy'));
}
gulp.task('build.parallax', function() {
return build(gulp.src([
'LICENSE',
'source/parallax.js',
'source/requestAnimationFrame.js'
]), 'parallax.js');
});
gulp.task('build.jquery.parallax', function() {
return build(gulp.src([
'LICENSE',
'source/jquery.parallax.js',
'source/requestAnimationFrame.js'
]), 'jquery.parallax.js');
});
gulp.task('clean', function() {
return gulp.src(['deploy'], {read: false}).pipe(plugins.clean());
});
gulp.task('build', ['clean'], function() {
gulp.start('build.parallax', 'build.jquery.parallax');
});
gulp.task('watch', function() {
gulp.watch('source/**/*.js', ['build']);
});
gulp.task('default', ['build']);