-
Notifications
You must be signed in to change notification settings - Fork 2
/
gulpfile.js
48 lines (42 loc) · 1.26 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
47
48
'use strict';
var jshint = require('gulp-jshint');
var gulp = require('gulp');
var open = require('gulp-open');
var config = require('./gulp.config')();
var $ = require('gulp-load-plugins')({ lazy: true });
var minify = require('gulp-minify');
var gulp_remove_logging = require("gulp-remove-logging");
var rseq = require('gulp-run-sequence');
var clean = require('gulp-clean');
gulp.task('start', function(){
gulp.src('app/first_start.html')
.pipe(open());
});
gulp.task('vet', function() {
console.log('Analyzing source with JSHint and JSCS');
return gulp
.src(config.alljs)
.pipe(jshint())
.pipe(jshint.reporter('default'));
});
gulp.task('dist', function(cb) {
// return rseq('min', ['remove_logging'], cb);
return rseq('clean', ['min'], cb);
});
gulp.task('clean', function() {
gulp.src('dist/*.js')
.pipe(clean({force: true}))
});
gulp.task('min', function() {
gulp.src('app/js/*.js')
.pipe(gulp_remove_logging({namespace: ['console', 'window.console']}))
.pipe(minify({
ext:{
src:'.js',
min:'-min.js'
},
exclude: ['tasks'],
ignoreFiles: ['.combo.js', '-min.js']
}))
.pipe(gulp.dest('dist'))
});