Gulp: Your Build Process Will Thank You

10
Gulp.js Your build process will thank you. Devon Campbell Presentation available online at bit.ly/knoxjsgulp

description

A quick intro to why you might use Gulp and how to get started. Produced for the May KnoxvilleJS Meetup. See a sample gulpfile from a recent project at https://gist.github.com/raddevon/35ce4c50855d8334ff2f

Transcript of Gulp: Your Build Process Will Thank You

  • 1. Gulp.js Your build process will thank you. Devon Campbell Presentation available online at bit.ly/knoxjsgulp

2. Gulp lets you establish a consistent build process up-front and run it every time youre ready to deploy. 3. Example: CSS prexing with gulp-autoprexer ! var prefix = require('gulp-autoprefixer'); ! ! gulp.task('css', function() { return gulp.src('style.css') .pipe(prefix("last 2 versions", "> 5%")) .pipe(gulp.dest('style.css')) }); https://www.npmjs.org/package/gulp-autoprexer 4. Now you know why you would use a task runner, but why would you choose Gulp? 5. Advantages of Gulp over Grunt Asynchronous by default Uses streams to avoid intermediary les 6. How to get started Install node & npm (http://nodejs.org/) Install Gulp globally (npm install -g gulp) Set up a blank package.json in your project Install Gulp for the project (npm install --save-dev gulp) Add gulple.js in your project and start adding plugins { "devDependencies": {} } var gulp = require(gulp'); ! gulp.task('default', function(){ // Default task code }); ! 7. Resources Code Fellows- Quick intro to Gulp.js http://www.codefellows.org/blogs/quick-intro-to-gulp-js The Front-end Tooling Book- Gulp chapter http://tooling.github.io/book-of-modern-frontend-tooling/build-systems/ gulp/introduction.html Nodejitsu- 9 gulp.js plugins for a great build system https://blog.nodejitsu.com/npmawesome-9-gulp-plugins/ Gulp Plugins Directory http://gulpjs.com/plugins/ 8. Thank you! Presentation available online at bit.ly/knoxjsgulp Devon Campbell | [email protected] Check out RadWorks at radworks.io.