forked from schlosser/pig.js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGulpfile.js
30 lines (25 loc) · 783 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
'use strict';
var gulp = require('gulp');
var jscs = require('gulp-jscs');
var jshint = require('gulp-jshint');
var plumber = require('gulp-plumber');
var rename = require('gulp-rename');
var uglify = require('gulp-uglify');
gulp.task('js:build', function() {
gulp.src(['./src/**/*.js', '!./src/**/*.min.js'])
.pipe(plumber())
.pipe(uglify())
.pipe(rename({suffix: '.min'}))
.pipe(gulp.dest('./src'));
});
gulp.task('js:lint', function() {
gulp.src(['./src/**/*.js', '!./src/**/*.min.js', 'Gulpfile.js'])
.pipe(plumber())
.pipe(jscs())
.pipe(jshint())
.pipe(jshint.reporter('default'));
});
gulp.task('build', ['js:lint', 'js:build']);
gulp.task('watch', ['build'], function() {
gulp.watch(['./src/**/*.js', 'Gulpfile.js'], ['build']);
});