-
Notifications
You must be signed in to change notification settings - Fork 39
/
gulpfile.js
45 lines (41 loc) · 1.08 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
const gulp = require('gulp');
const connect = require('gulp-connect');
const open = require('open');
const jscs = require('gulp-jscs');
const jshint = require('gulp-jshint');
const stylish = require('gulp-jscs-stylish');
const uglify = require('gulp-uglify');
const pump = require('pump');
const concat = require('gulp-concat');
gulp.task('connect', function () {
// runs connect server
connect.server({
root: ""
});
});
gulp.task('open', function () {
// open browser
var uri = 'http://localhost:8080/test/test.html';
open(uri);
});
gulp.task('checkcode', function () {
// validate source code using jscs and jshint
gulp.src('.')
.pipe(jshint())
.pipe(jscs())
.on('error', function () { })
.pipe(stylish.combineWithHintResults())
.pipe(jshint.reporter('jshint-stylish'));
});
gulp.task('build', function (cb) {
pump([
gulp.src('./src/**/*.js'),
concat('animatelo.min.js'),
uglify({
preserveComments: 'license'
}),
gulp.dest('dist')
],
cb
);
});