Cache linted files

This commit is contained in:
Ken-Håvard Lieng 2015-06-08 01:06:08 +02:00
parent fe392a08ff
commit 27552a2e9c
2 changed files with 5 additions and 1 deletions

View File

@ -17,6 +17,7 @@ var babelify = require('babelify');
var strictify = require('strictify'); var strictify = require('strictify');
var watchify = require('watchify'); var watchify = require('watchify');
var merge = require('merge-stream'); var merge = require('merge-stream');
var cache = require('gulp-cached');
var argv = require('yargs') var argv = require('yargs')
.alias('p', 'production') .alias('p', 'production')
@ -87,6 +88,7 @@ function js(watch) {
gulp.task('lint', function() { gulp.task('lint', function() {
return gulp.src('src/js/**/*.{js,jsx}') return gulp.src('src/js/**/*.{js,jsx}')
.pipe(cache('lint'))
.pipe(eslint()) .pipe(eslint())
.pipe(eslint.format()) .pipe(eslint.format())
.pipe(eslint.failOnError()); .pipe(eslint.failOnError());
@ -108,8 +110,9 @@ gulp.task('gzip', ['html', 'css', 'js', 'fonts'], function() {
.pipe(gulp.dest('dist/gz')); .pipe(gulp.dest('dist/gz'));
}); });
gulp.task('gzip:watch', ['lint'], function() { gulp.task('gzip:watch', function() {
return gulp.src('dist/**/*.{html,css,js}') return gulp.src('dist/**/*.{html,css,js}')
.pipe(cache('gzip'))
.pipe(gzip()) .pipe(gzip())
.pipe(gulp.dest('dist/gz')); .pipe(gulp.dest('dist/gz'));
}); });

View File

@ -11,6 +11,7 @@
"eslint-plugin-react": "^2.4.0", "eslint-plugin-react": "^2.4.0",
"gulp": "~3.8.10", "gulp": "~3.8.10",
"gulp-autoprefixer": "2.2.0", "gulp-autoprefixer": "2.2.0",
"gulp-cached": "^1.1.0",
"gulp-concat": "~2.5.2", "gulp-concat": "~2.5.2",
"gulp-eslint": "0.13.2", "gulp-eslint": "0.13.2",
"gulp-gzip": "0.0.8", "gulp-gzip": "0.0.8",