It has been some time since JavaScript build tools like Grunt or Gulp were just the "next big thing" for web developers. Working without them is nearly unimaginable nowadays and it seems that there's almost no problem in our day to day workflow which cannot be solved by simply using just another plugin.
But are build tools really the answer to everything?
In this talk, we will take a look at the ten most common problems which seem to be unsolved by using just the build tool basics. We will create advanced building pipelines for our custom processes and find out reusable patterns which can be applied to similar issues.
4. Sass CoffeeScript LESS
P o s t C S S H A M L J a d e
U g l i f y E S 6 R e a c t J S
B r o w s e r i f y A n g u l a r J S
E m b e r C S S M i n J S L i n t
ESHint ImageOptim Mocha
Jasmine TypeScript
5.
6.
7.
8. 1530 lines of code
original Ant tasks used:
concat — copy — delete — mkdir
9.
10. Maybe Java isn't the right
tool?
Java is to JavaScript what
Alf is to Gandalf
49. Some tasks take long
gulp.src(‘scripts/*.js’)!
.pipe(uglify())!
.pipe(gulp.dest())!
.pipe(concat())!
Too much is going on!
Each change: Uglify all
the files?
50. filter files
that have changed
do performance
heavy operations
remember the
old files
and continue
with the other ops
52. gulp.task('scripts', function () {!
return gulp.src('app/scripts/**/*.js')!
.pipe(cached('ugly'))!
.pipe(uglify())!
.pipe(remember('ugly'))!
.pipe(concat('main.min.js'))!
.pipe(gulp.dest('dist/scripts'));!
});!
we use the cache to
check if files have
changed
53. gulp.task('scripts', function () {!
return gulp.src('app/scripts/**/*.js')!
.pipe(cached('ugly'))!
.pipe(uglify())!
.pipe(remember('ugly'))!
.pipe(concat('main.min.js'))!
.pipe(gulp.dest('dist/scripts'));!
});!
once we are done,
we remember all
the other files
we stored in
the cache