-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
35 lines (29 loc) · 838 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
var gulp = require('gulp');
var concat = require('gulp-concat');
var uglify = require('gulp-uglify');
var jsInline = require('gulp-js-inline');
gulp.task('js', ['glsl'], function() {
return gulp.src(['js/*.js', 'gen/*.js'])
.pipe(concat('book.min.js'))
.pipe(uglify())
.pipe(gulp.dest('www'));
});
gulp.task('ext', function() {
return gulp.src('ext/*.js')
.pipe(concat('bundle.min.js'))
.pipe(uglify())
.pipe(gulp.dest('www'));
});
gulp.task('glsl', function() {
return gulp.src('glsl/*.c')
.pipe(jsInline({ 'name': 'glslStore' }))
.pipe(concat('glsl.js'))
.pipe(gulp.dest('gen'));
});
gulp.task('watch', ['default'], function() {
gulp.watch('js/*.js', ['js']);
gulp.watch('gen/*.js', ['js']);
gulp.watch('glsl/*.c', ['glsl']);
gulp.watch('ext/*', ['ext']);
});
gulp.task('default', ['js', 'ext', 'glsl']);