From 89c290f645327187d5e840bdec725bf9bde772ad Mon Sep 17 00:00:00 2001 From: Tim Lancina Date: Thu, 4 Jun 2015 13:09:49 -0500 Subject: [PATCH] cache rules everything around me --- gulpfile.js | 16 ++++++---------- package.json | 2 +- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/gulpfile.js b/gulpfile.js index 84a424d06b..6b64bc56fb 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -21,6 +21,7 @@ var babel = require('gulp-babel'); var traceur = require('gulp-traceur'); var webpack = require('gulp-webpack'); var lazypipe = require('lazypipe'); +var cache = require('gulp-cached'); gulp.task('clean.build', function() { @@ -46,22 +47,15 @@ gulp.task('build', function() { gulp.task('watch', function() { runSequence( - 'clean', - 'ionic.traceur', - 'ionic.bundle.deps', - 'ionic.bundle.js', + 'ionic.transpile', 'ionic.examples', 'sass', 'fonts', 'polyfills', function() { - watch('ionic/**/*.js', function() { - gulp.start(''); - }); - - watch('ionic/components/*/test/**/*', function() { - doubleCheckDistFiles(); + watch(['ionic/**/*.js', 'ionic/components/*/test/**/*'], function() { + gulp.start('ionic.transpile'); gulp.start('ionic.examples'); }); @@ -108,6 +102,7 @@ var babelOptions = { gulp.task('ionic.transpile', function(done) { return gulp.src(['ionic/**/*.js', '!ionic/components/*/test/**/*']) + .pipe(cache('transpile', { optimizeMemory: true })) .pipe(traceur(traceurOptions)) .pipe(gulp.dest('dist/js/es6/ionic')) .pipe(babel(babelOptions)) @@ -142,6 +137,7 @@ gulp.task('ionic.examples', function() { // Get each test folder with gulp.src return gulp.src('ionic/components/*/test/*/**/*') + .pipe(cache('examples', { optimizeMemory: true })) .pipe(gulpif(/.js$/, buildTest())) .pipe(gulpif(/index.js$/, createIndexHTML())) .pipe(rename(function(file) { diff --git a/package.json b/package.json index 7961e8f557..4026fc3761 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,7 @@ "gulp": "~3.8.10", "gulp-autoprefixer": "^2.3.0", "gulp-babel": "^5.1.0", - "gulp-cached": "^1.0.4", + "gulp-cached": "^1.1.0", "gulp-concat": "~2.5.0", "gulp-debug": "~2.0.1", "gulp-if": "^1.2.5",