forked from a11yproject/colorable
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
36 lines (29 loc) · 859 Bytes
/
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
var gulp = require('gulp');
var browserify = require('browserify');
var transform = require('vinyl-transform');
var uglify = require('gulp-uglify');
var rename = require('gulp-rename');
var webserver = require('gulp-webserver');
var build = require('./docs/src/build');
gulp.task('build', function() {
var data = require('./docs/src/data');
build(data);
});
gulp.task('js', function() {
var browserified = transform(function(filename) {
var b = browserify(filename);
return b.bundle();
});
gulp.src('./docs/src/app.js')
.pipe(browserified)
.pipe(uglify())
.pipe(rename({ extname: '.min.js' }))
.pipe(gulp.dest('./docs'));
});
gulp.task('serve', function() {
gulp.src('.')
.pipe(webserver());
});
gulp.task('default', ['build', 'js', 'serve'], function() {
gulp.watch(['./docs/src/**/*'], ['build', 'js']);
});