-
Notifications
You must be signed in to change notification settings - Fork 32
/
gulpfile.js
46 lines (39 loc) · 1.23 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
43
44
45
46
(function(){
'use strict';
var jshint = require('gulp-jshint');
var uglify = require('gulp-uglify');
var rename = require("gulp-rename");
var gulp = require('gulp');
var jsHintFiles = [
'**/*.js',
'**/*.html',
'!node_modules/**',
'!src/third-party/**',
'!build/**'
];
// gulp.task('default', function() {
// // place code for your default task here
// });
gulp.task('default', ['jsHint']);
gulp.task('jsHint', function() {
return gulp.src(jsHintFiles)
.pipe(jshint.extract('auto'))
.pipe(jshint())
.pipe(jshint.reporter('jshint-stylish'))
.pipe(jshint.reporter('fail'));
});
gulp.task('jsHint-watch', function() {
gulp.watch(jsHintFiles).on('change', function(event) {
gulp.src(event.path)
.pipe(jshint.extract('auto'))
.pipe(jshint())
.pipe(jshint.reporter('jshint-stylish'));
});
});
gulp.task('compress', function() {
return gulp.src('src/minimal-gltf-loader.js')
.pipe(uglify())
.pipe(rename({suffix: '.min'}))
.pipe(gulp.dest('build'));
});
})();