-
Notifications
You must be signed in to change notification settings - Fork 3
/
gulpfile.js
53 lines (47 loc) · 1.34 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
50
51
52
53
var gulp = require('gulp');
var babel = require('gulp-babel');
var rename = require('gulp-rename');
var jshint = require('gulp-jshint');
var jscs = require('gulp-jscs');
var stylish = require('gulp-jscs-stylish');
var uglify = require('gulp-uglify');
var noop = function () {};
var connect = require('gulp-connect');
gulp.task('connect', function () {
return connect.server({
livereload: true,
port: 1337
});
});
gulp.task('html', function () {
return gulp.src('./examples/*')
.pipe(connect.reload());
});
gulp.task('babel', function () {
return gulp.src('./src/index.js')
.pipe(jshint({
esnext: true,
curly: true,
eqeqeq: true,
forin: true,
freeze: true,
maxparams: 3
}))
.pipe(jscs())
.on('error', noop)
.pipe(stylish())
.pipe(rename('tabs.js'))
.pipe(gulp.dest('./dist'))
.pipe(babel())
.pipe(rename('tabs.es5.js'))
.pipe(gulp.dest('./dist'))
.pipe(uglify())
.pipe(rename('tabs.es5.min.js'))
.pipe(gulp.dest('./dist'))
.pipe(connect.reload());
});
gulp.task('watch', function () {
gulp.watch('./examples/*', ['html']);
return gulp.watch('./src/index.js', ['babel']);
});
gulp.task('default', ['connect', 'html', 'babel', 'watch']);