forked from alemangui/pizzicato
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgulpfile.js
More file actions
44 lines (34 loc) · 1 KB
/
Copy pathgulpfile.js
File metadata and controls
44 lines (34 loc) · 1 KB
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
var gulp = require('gulp');
var include = require('gulp-include');
var jshint = require('gulp-jshint');
var stylish = require('jshint-stylish');
var uglify = require('gulp-uglify');
var rename = require('gulp-rename');
var KarmaServer = require('karma').Server;
gulp.task('hint', function() {
var stream = gulp.src('./src/**/*.js')
.pipe(jshint())
.pipe(jshint.reporter('jshint-stylish'))
.pipe(jshint.reporter('fail'));
return stream;
});
gulp.task('scripts', ['hint'], function() {
var stream = gulp.src('./src/Pizzicato.js')
.pipe(include())
.pipe(gulp.dest('./distr'))
.pipe(gulp.dest('./site'))
.pipe(rename('Pizzicato.min.js'))
.pipe(uglify())
.pipe(gulp.dest('./distr'));
return stream;
});
gulp.task('test', ['scripts'], function(done) {
new KarmaServer({
configFile: __dirname + '/karma.conf.js',
singleRun: true
}, done).start();
})
gulp.task('watch', ['scripts'], function() {
gulp.watch(['./src/**/*.js'], ['scripts']);
});
gulp.task('default', ['hint', 'scripts', 'test']);