Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Improving build time with Gulp and Babel

I'm trying to speed up the build time after adding gulp-babel to my build process...

At first I thought gulp-cached might help, but this resulted in the compiled file only containing those files that were most recently edited (I see now that's how gulp-cached works).

Without babel my build time was < 200ms.
With babel it's up to 1.5 seconds.
I sure would like to have it back down to 200ms...

Any ideas?

like image 296
sfletche Avatar asked Jul 29 '15 22:07

sfletche


1 Answers

Use gulp-cached and gulp-remember. Only files that have changed will go through the pipeline and then gulp-remembers adds them all back in. :)

return gulp.src(array)                                                        
    .pipe(cached('babel is fun'))                                                      
    .pipe(babel())                                                           
    .pipe(remember('babel is fun'))                                                    
    .pipe(gulp.dest(dir));
like image 85
user133688 Avatar answered Nov 08 '22 02:11

user133688