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
5.5k
2
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
gulp-internal
implementation about gulp
yiminghe
August 22, 2014
More Decks by yiminghe
See All by yiminghe
小程序终端技术架构
yiminghe
0
290
支付宝小程序的开放架构
yiminghe
0
220
gitc2016 react based architecture
yiminghe
1
190
antd at qcon2016
yiminghe
1
250
react-based architecture
yiminghe
2
190
React Ecosystem At Ant Financial
yiminghe
4
2.3k
ant design preview
yiminghe
1
340
react best practice
yiminghe
3
230
react at alipay
yiminghe
43
4.6k
Other Decks in Technology
See All in Technology
どこまでAIに任せるか 〜確率論と決定論の境界決定〜
shukob
0
170
Genie Ontologyは銀の弾丸かを考える / Is Genie Ontology a Silver Bullet?
nttcom
0
420
キャリアLT会#3
beli68
0
170
「守りたい体験」を渡すだけで E2E を生成させられるようになった話
hinac0
2
910
プロダクト開発組織の現在地(Ver.2026/07) / product-organization
kaonavi
0
130
Network Firewallやっていき!
news_it_enj
0
220
AI Native なプロダクト組織の立ち上げ方 : 生産性 100 倍への挑戦
mikesorae
0
770
AI、CDK と協働する Full TypeScript アプリケーション開発 / Full TypeScript Application with AI and CDK
geekplus_tech
2
430
41歳でAWSが好きすぎてITエンジニアになったおっさんの話
yama3133
1
650
壊して学ぶAWS CDK: そのcdk deployで消えるもの、残るもの
k_adachi_01
1
440
仕様駆動開発、導入半年。「本当に速くなってるの?」にデータで答える / AICon2026_hirakawa
rakus_dev
0
270
AIが当たり前の組織で エンジニアはどう育つか
nishihira
1
560
Featured
See All Featured
The untapped power of vector embeddings
frankvandijk
2
1.8k
Speed Design
sergeychernyshev
33
1.9k
Building a Scalable Design System with Sketch
lauravandoore
463
34k
End of SEO as We Know It (SMX Advanced Version)
ipullrank
3
4.3k
Ecommerce SEO: The Keys for Success Now & Beyond - #SERPConf2024
aleyda
1
2.1k
Side Projects
sachag
455
43k
How to Get Subject Matter Experts Bought In and Actively Contributing to SEO & PR Initiatives.
livdayseo
0
150
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
508
140k
Chasing Engaging Ingredients in Design
codingconduct
0
240
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
47
8.2k
Building a A Zero-Code AI SEO Workflow
portentint
PRO
0
640
Beyond borders and beyond the search box: How to win the global "messy middle" with AI-driven SEO
davidcarrasco
3
190
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())