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

gulp-internal

yiminghe
August 22, 2014

 gulp-internal

implementation about gulp

yiminghe

August 22, 2014
Tweet

More Decks by yiminghe

Other Decks in Technology

Transcript

  1. feature • No temporary file • virtual memory file content

    transfer • Full stream support • stream. Readable • stream. Writable • stream. Transform • through2
  2. through2 • Easy to create stream.Transform and compatible with 0.8-

    • through2(option, function transform(chunk,encoding,callback){},function flush(){}) • === • var stream = new MyTransform(option); // extends stream.Transform stream._transform = transform; stream._flush = flush; return stream;
  3. Local lib • Api • Gulp.src • Gulp.dest • Gulp.task

    • * Gulp.watch • Depends • vinyl • vinyl-fs • orchestrator
  4. Orchestrator • A module for sequencing and executing tasks and

    dependencies in maximum concurrency • Gulp.task(name, deps, function(){}) • KISSY.add(name,deps,function(){}) • ‘default’
  5. Task end condition • Promise resolved • Callback called •

    Stream end • Task(‘x’,function(callback){ • Return promise or stream • Or • Callback() • });
  6. plugins • Return stream.Transform • Operate on vinyl file •

    Example • Gulp-concat • Gulp-uglify • Gulp-modulex