Gulp
jure.suvak@dlabs.s
@jur3
Jure Šuvak
@jur3
WHAT IS GULP ?
• Stream-based build system
• NodeJS
• Code (javascript) over configuration
• Asynchronous
• Simple API
• Plugin based
• Easy
STREAMS
• One read, one write
• From Node
• Readable, writable
stream
• a.pipe(b);
• b.pipe(c);
• c.pipe(d);
https://github.com/substack/stream-handboo
GULP API
Only 4 commands
• gulp.src(globs,[options])
Takes files and start emitting them, returns readable stream.
• gulp.dest(path, [options])
Save files to file system.
https://github.com/gulpjs/gulp/blob/master/docs/API.md
• gulp.task(name[, deps], fn)
Define a task, can be used as dependency, must have a return
• gulp.watch(glob[, opts], tasks)
Watch files for changes
https://github.com/gulpjs/gulp/blob/master/docs/API.md
PLUGINS
• plugin for everything :)
• 1533 plugins
http://gulpjs.com/plugins/
http://ipestov.com/essential-plugins-for-gulp
GULP-CLEAN
• clean (remove) files
• running as first task to
clean workspace
GULP-CONCAT
GULP- UGLIFY
• nice to have only one JS
file
• concat all JS files
• minify it
GULP-INJECT
• inject files in our layout
• multiple placeholders
LET’S START
• Install NodeJS
• Install Gulp
$ npm install --global gulp
• Create Gulp.js file
• Run Gulp
LET’S ASSEMBLE IT
Q/A
jure.suvak@dlabs.s
@jur3
Jure Šuvak
jobs@dlabs.si

Getting Started with Gulp