Lock in $30 Savings on PRO—Offer Ends Soon! ⏳
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
240
支付宝小程序的开放架构
yiminghe
0
190
gitc2016 react based architecture
yiminghe
1
170
antd at qcon2016
yiminghe
1
230
react-based architecture
yiminghe
2
160
React Ecosystem At Ant Financial
yiminghe
4
2.3k
ant design preview
yiminghe
1
310
react best practice
yiminghe
3
210
react at alipay
yiminghe
43
4.4k
Other Decks in Technology
See All in Technology
Oracle Cloud Infrastructure IaaS 新機能アップデート 2025/09 - 2025/11
oracle4engineer
PRO
0
100
生成AI時代におけるグローバル戦略思考
taka_aki
0
170
Lambdaの常識はどう変わる?!re:Invent 2025 before after
iwatatomoya
1
480
品質のための共通認識
kakehashi
PRO
3
250
Kubernetes Multi-tenancy: Principles and Practices for Large Scale Internal Platforms
hhiroshell
0
120
Challenging Hardware Contests with Zephyr and Lessons Learned
iotengineer22
0
190
業務のトイルをバスターせよ 〜AI時代の生存戦略〜
staka121
PRO
2
120
【AWS re:Invent 2025速報】AIビルダー向けアップデートをまとめて解説!
minorun365
4
510
EM歴1年10ヶ月のぼくがぶち当たった苦悩とこれからへ向けて
maaaato
0
280
GitHub Copilotを使いこなす 実例に学ぶAIコーディング活用術
74th
3
2.9k
CARTAのAI CoE が挑む「事業を進化させる AI エンジニアリング」 / carta ai coe evolution business ai engineering
carta_engineering
0
950
AIプラットフォームにおけるMLflowの利用について
lycorptech_jp
PRO
1
130
Featured
See All Featured
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
254
22k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
162
16k
Reflections from 52 weeks, 52 projects
jeffersonlam
355
21k
Fireside Chat
paigeccino
41
3.7k
Scaling GitHub
holman
464
140k
Music & Morning Musume
bryan
46
7k
The Invisible Side of Design
smashingmag
302
51k
Imperfection Machines: The Place of Print at Facebook
scottboms
269
13k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
55
3.1k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
12
970
Done Done
chrislema
186
16k
Building a Modern Day E-commerce SEO Strategy
aleyda
45
8.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())