-
Notifications
You must be signed in to change notification settings - Fork 9
/
gulpfile.js
36 lines (32 loc) · 857 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
36
var gulp = require('gulp');
var browserify = require('browserify');
var uglify = require('gulp-uglify');
var source = require('vinyl-source-stream');
var buffer = require('vinyl-buffer');
var rename = require('gulp-rename');
var jshint = require('gulp-jshint');
var paths = {
dest: 'build'
};
// ** Compilation ** //
gulp.task('default', ['build']);
gulp.task('build', function() {
var b = browserify({
entries: './js2glsl.js',
standalone: 'js2glsl',
debug: true
});
return b.bundle()
.pipe(source('js2glsl.js'))
.pipe(buffer())
.pipe(gulp.dest(paths.dest))
.pipe(uglify())
.pipe(rename({ extname: '.min.js' }))
.pipe(gulp.dest(paths.dest));
});
// ** Lint ** //
gulp.task('lint', function() {
return gulp.src(['./*.js', './libs/*.js'])
.pipe(jshint())
.pipe(jshint.reporter('default'));
});