-
Notifications
You must be signed in to change notification settings - Fork 1
/
gulpfile.js
43 lines (34 loc) · 1.12 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
var gulp = require('gulp')
, browserify = require('browserify')
, uglify = require('gulp-uglify')
, source = require('vinyl-source-stream')
, buffer = require('vinyl-buffer')
, shell = require('gulp-shell')
;
var src = 'src/main.js'
gulp.task('build', function(){
browserify(src)
.bundle()
.on('error', function(err){ console.log(err.message); })
.pipe(source('chordPlayer.js')) //output stream
.pipe(gulp.dest('lib/'))
;
});
gulp.task('compress', function(){
browserify(src)
.bundle()
.on('error', function(err){ console.log(err.message); })
.pipe(source('chordPlayer.min.js')) //output stream
.pipe(buffer())
.pipe(uglify())
.on('error', function(err){ console.log(err); })
.pipe(gulp.dest('lib/'))
;
});
gulp.task( 'doc', shell.task( [
'./node_modules/jsdoc/jsdoc.js src/chordPlayer.js -d doc/ -P package.json -R README.md '
] ) );
gulp.task('watch', function() {
gulp.watch([src,'src/chordPlayer.js'], ['build','compress','doc']);
});
gulp.task('default', ['build','compress','doc','watch']);