Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
gulp-internal
Search
yiminghe
August 22, 2014
Technology
2
5.3k
gulp-internal
implementation about gulp
yiminghe
August 22, 2014
Tweet
Share
More Decks by yiminghe
See All by yiminghe
小程序终端技术架构
yiminghe
0
250
支付宝小程序的开放架构
yiminghe
0
200
gitc2016 react based architecture
yiminghe
1
170
antd at qcon2016
yiminghe
1
240
react-based architecture
yiminghe
2
170
React Ecosystem At Ant Financial
yiminghe
4
2.3k
ant design preview
yiminghe
1
320
react best practice
yiminghe
3
220
react at alipay
yiminghe
43
4.5k
Other Decks in Technology
See All in Technology
Digitization部 紹介資料
sansan33
PRO
1
6.8k
顧客の言葉を、そのまま信じない勇気
yamatai1212
1
330
茨城の思い出を振り返る ~CDKのセキュリティを添えて~ / 20260201 Mitsutoshi Matsuo
shift_evolve
PRO
1
180
GitHub Issue Templates + Coding Agentで簡単みんなでIaC/Easy IaC for Everyone with GitHub Issue Templates + Coding Agent
aeonpeople
1
170
システムのアラート調査をサポートするAI Agentの紹介/Introduction to an AI Agent for System Alert Investigation
taddy_919
2
1.7k
顧客との商談議事録をみんなで読んで顧客解像度を上げよう
shibayu36
0
150
月間数億レコードのアクセスログ基盤を無停止・低コストでAWS移行せよ!アプリケーションエンジニアのSREチャレンジ💪
miyamu
0
800
レガシー共有バッチ基盤への挑戦 - SREドリブンなリアーキテクチャリングの取り組み
tatsukoni
0
200
Kiro IDEのドキュメントを全部読んだので地味だけどちょっと嬉しい機能を紹介する
khmoryz
0
160
外部キー制約の知っておいて欲しいこと - RDBMSを正しく使うために必要なこと / FOREIGN KEY Night
soudai
PRO
11
4.6k
ブロックテーマでサイトをリニューアルした話 / 2026-01-31 Kansai WordPress Meetup
torounit
0
440
【インシデント入門】サイバー攻撃を受けた現場って何してるの?
shumei_ito
0
1.5k
Featured
See All Featured
Building Applications with DynamoDB
mza
96
6.9k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
31
3.1k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
162
16k
Making the Leap to Tech Lead
cromwellryan
135
9.7k
The SEO identity crisis: Don't let AI make you average
varn
0
64
My Coaching Mixtape
mlcsv
0
46
Chasing Engaging Ingredients in Design
codingconduct
0
110
The Hidden Cost of Media on the Web [PixelPalooza 2025]
tammyeverts
2
170
From π to Pie charts
rasagy
0
120
The AI Revolution Will Not Be Monopolized: How open-source beats economies of scale, even for LLMs
inesmontani
PRO
3
3k
The Organizational Zoo: Understanding Human Behavior Agility Through Metaphoric Constructive Conversations (based on the works of Arthur Shelley, Ph.D)
kimpetersen
PRO
0
230
SEO Brein meetup: CTRL+C is not how to scale international SEO
lindahogenes
0
2.3k
Transcript
Gulp-internal
[email protected]
Gulp • A build system based on stream
sample • gulpfile.js: var gulp = require(‘gulp’) gulp.src(‘lib/**/*.js’) .pipe(concat()) .pipe(rename(‘concat.js’))
.pipe(gulp.dest(‘build’)) • run: gulp
feature • No temporary file • virtual memory file content
transfer • Full stream support • stream. Readable • stream. Writable • stream. Transform • through2
gulp • global cli • local lib • plugins/streams
cli • Depends • liftoff Change cwd require gulpfile require
gulp .start
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;
Local lib • Api • Gulp.src • Gulp.dest • Gulp.task
• * Gulp.watch • Depends • vinyl • vinyl-fs • orchestrator
vinyl • Virtual file representation • { content: buffer/stream path:
}
Gulp.src • === require(‘vinyl-fs’).src • return stream.Transform({object:true}) • Emit Stream
of vinyl file
Gulp.dest • === require(‘vinyl-fs’).dest • return stream.Transform({object:true}) • Save file
and Emit Stream of saved vinyl file
Orchestrator • A module for sequencing and executing tasks and
dependencies in maximum concurrency • Gulp.task(name, deps, function(){}) • KISSY.add(name,deps,function(){}) • ‘default’
Task end condition • Promise resolved • Callback called •
Stream end • Task(‘x’,function(callback){ • Return promise or stream • Or • Callback() • });
plugins • Return stream.Transform • Operate on vinyl file •
Example • Gulp-concat • Gulp-uglify • Gulp-modulex
• gulp.src(‘./gulp-internal’).pipe(audience()).pipe(thanks())