Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
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
350
支付宝小程序的开放架构
yiminghe
0
280
gitc2016 react based architecture
yiminghe
1
200
antd at qcon2016
yiminghe
1
260
react-based architecture
yiminghe
2
200
React Ecosystem At Ant Financial
yiminghe
4
2.3k
ant design preview
yiminghe
1
360
react best practice
yiminghe
3
250
react at alipay
yiminghe
43
4.6k
Other Decks in Technology
See All in Technology
Sizing, Benchmarking and Performance Tuning Apache Flink Clusters
rmetzger
0
140
MCPでAIが自分で調べに行く
cdataj
0
130
公共分野での生成AI活用
toru_kubota
1
310
AI時代に求められる優秀なTechLeadの振る舞い
pospome
11
16k
PostgreSQL オプティマイザ統計の秘密
nori_shinoda
1
450
Kiro IDE 入門 (画面の各部から、頼み方、任せ方、戻し方まで) | 目指せ Kiro マスター 02
inariku
PRO
4
180
セキュリティ専任チームなしで攻撃を先回りするSREが実践したSIEM on Amazon OpenSearch Service
cscengineer
PRO
1
730
bpf_arenaとstruct_opsを使うのが難しかった話
masu_mi
0
220
Cloudflareの向き先
chimame
1
160
evcc & Home Assistant
naltatis
0
480
基本から分かる!AWSセキュリティ運用の考え方と任せ方
cmusudakeisuke
1
480
バックオフィスに染み出すTypeScript ── clasp で安全に仕組みを作る
nealle
1
200
Featured
See All Featured
30 Presentation Tips
portentint
PRO
1
460
jQuery: Nuts, Bolts and Bling
dougneiner
66
8.7k
Game over? The fight for quality and originality in the time of robots
wayneb77
1
330
The Organizational Zoo: Understanding Human Behavior Agility Through Metaphoric Constructive Conversations (based on the works of Arthur Shelley, Ph.D)
kimpetersen
PRO
0
530
Building a Scalable Design System with Sketch
lauravandoore
464
34k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
31
3.4k
Visualization
eitanlees
153
17k
Everyday Curiosity
cassininazir
0
400
Become a Pro
speakerdeck
PRO
31
6.4k
The Art of Programming - Codeland 2020
erikaheidi
57
14k
The AI Search Optimization Roadmap by Aleyda Solis
aleyda
2
6.4k
Rails Girls Zürich Keynote
gr2m
96
14k
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())