Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Automating Large Applications on Modular and St...

Automating Large Applications on Modular and Structured Form with Gulp

Automating Large Applications on Modular and Structured Form with Gulp

Avatar for Anderson Aguiar

Anderson Aguiar

May 18, 2015
Tweet

More Decks by Anderson Aguiar

Other Decks in Programming

Transcript

  1. E

  2. API SIMPLE • gulp.task(name, [deps,], fn)
 define a task with

    optional dependencies.
 • gulp.src(glob)
 create a stream from given file system glob.
 • gulp.dest(folder)
 save files from a stream to given directory.
 • gulp.watch(glob, tasks)
 run a task when one of the globed files is changed. are just four functions
  3. Download and install node.js: https://nodejs.org/ npm i gulp -g #1

    - INSTALL NODE.JS & GULP Install gulp globally:
  4. • Create a project • Install global Gulp
 • Create

    a package.json • Install local Gulp • Create and configure a Gulpfile.js npm init [sudo] npm i -g gulp npm i gulp --save-dev #2 - CONFIGURE DEV ENVIRONMENT
  5. Install from npm npm i gulp-uglify --save-dev Adding to gulp

    file using require INSTALLING A PLUGIN
  6. STREAMS are fast find . | grep -l "coffeescript" |

    xargs -I {} rm -rf {} Base on pipe unix
  7. gulp.lastRun(task, [timeResolution]) => [Timestamp] gulp.tree([options]) => Object gulp.series(taskName || fn...)

    => Function gulp.parallel(taskName || fn...) => Function 
 https://github.com/gulpjs/gulp/labels/gulp4

  8. ORGANIZE YOUR TASKS BY CONTEXT _default system css js img

    html dev build deploy … copy delete move rename exec … preprocessor source maps lints …
 hint lint uglify formatter test … optmin total size … minify replace …