-
-
Notifications
You must be signed in to change notification settings - Fork 28
/
Copy pathgulpfile.js
39 lines (34 loc) · 799 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
'use strict';
var gulp = require('gulp'),
plugins = require('gulp-load-plugins')();
gulp.task('coffee', function () {
gulp.src('src/*.coffee')
.pipe(plugins.coffee({ bare: true }).on('error', plugins.util.log))
.pipe(gulp.dest('./'))
.pipe(plugins.eslint({
globals: {
'jQuery': true
},
env: {
browser: true
}
}))
.pipe(plugins.eslint.format())
.pipe(plugins.size());
});
gulp.task('minify', function() {
gulp.src('jquery.phoenix.js')
.pipe(plugins.uglify())
.pipe(plugins.rename(function (path) {
if(path.extname === '.js') {
path.basename += '.min';
}
}))
.pipe(gulp.dest('./'))
.pipe(plugins.size());
});
gulp.task('build', ['coffee', 'minify']);
gulp.task('default', ['build']);
gulp.task('watch', function () {
gulp.watch('src/*.coffee', ['coffee']);
});