forked from nexus-js/ui
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
43 lines (34 loc) · 1.15 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
var gulp = require('gulp')
, rename = require('gulp-rename')
, gutil = require('gulp-util')
, browserify = require('browserify')
, source = require('vinyl-source-stream')
, uglify = require('gulp-uglify')
, runSequence = require('run-sequence')
var path = require('path');
var jsdox = require("jsdox");
var watcher = gulp.watch(['./lib/**/*.js', './lib/*.js'], ['default'])
watcher.on('change', function(event) {
console.log('File '+event.path+' was '+event.type+', running tasks...')
})
gulp.task('browserify', function() {
return browserify({ entries: './index.js' })
.bundle()
.on('error', gutil.log)
.pipe(source('nexusUI.js'))
.pipe(gulp.dest('./dist/'))
})
gulp.task('uglify', function() {
return gulp.src('./dist/nexusUI.js')
.pipe(uglify())
.pipe(rename('nexusUI.min.js'))
.pipe(gulp.dest('./dist/'))
})
var logdox = function(err) { err ? console.log(err) : null }
gulp.task('jsdox', function() {
jsdox.generateForDir("dist/nexusUI.js", "./api/", logdox);
//jsdox.generateForDir("lib/widgets", "./api/", logdox);
})
gulp.task('default', function(done) {
runSequence('browserify', 'uglify', 'jsdox', done)
})