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.js
Search
Samuel Flores
August 09, 2014
Technology
1
150
Gulp.js
Automatizando o build do front end das suas apps, de maneira rápida e fácil.
Samuel Flores
August 09, 2014
Tweet
Share
More Decks by Samuel Flores
See All by Samuel Flores
Clojure
samflores
4
200
Introdução ao MRuby
samflores
1
56
Por que Ruby?
samflores
1
140
Extendendo Ruby com C (& cartoons)
samflores
3
180
Sinatra
samflores
2
220
Other Decks in Technology
See All in Technology
2025-07-06 QGIS初級ハンズオン「はじめてのQGIS」
kou_kita
0
180
What’s new in Android development tools
yanzm
0
460
【あのMCPって、どんな処理してるの?】 AWS CDKでの開発で便利なAWS MCP Servers特集
yoshimi0227
4
290
OpenTelemetryセマンティック規約の恩恵とMackerel APMにおける活用例 / SRE NEXT 2025
mackerelio
2
770
united airlines ™®️ USA Contact Numbers: Complete 2025 Support Guide
flyunitedhelp
1
440
Sansanのデータプロダクトマネジメントのアプローチ
sansantech
PRO
0
200
マーケットプレイス版Oracle WebCenter Content For OCI
oracle4engineer
PRO
3
970
インフラ寄りSREの生存戦略
sansantech
PRO
7
2.5k
アクセスピークを制するオートスケール再設計: 障害を乗り越えKEDAで実現したリソース管理の最適化
myamashii
1
130
How to Quickly Call American Airlines®️ U.S. Customer Care : Full Guide
flyaahelpguide
0
150
Lakebaseを使ったAIエージェントを実装してみる
kameitomohiro
0
160
マネジメントって難しい、けどおもしろい / Management is tough, but fun! #em_findy
ar_tama
7
1.2k
Featured
See All Featured
jQuery: Nuts, Bolts and Bling
dougneiner
63
7.8k
Building Flexible Design Systems
yeseniaperezcruz
328
39k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
161
15k
Docker and Python
trallard
44
3.5k
Typedesign – Prime Four
hannesfritz
42
2.7k
Measuring & Analyzing Core Web Vitals
bluesmoon
7
510
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
26k
Six Lessons from altMBA
skipperchong
28
3.9k
Fantastic passwords and where to find them - at NoRuKo
philnash
51
3.3k
A designer walks into a library…
pauljervisheath
207
24k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
53
2.9k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
29
1.8k
Transcript
@samflores
None
Twitter Bootstrap Slider Parallax jQuery Backbone
1 .css & 1 .js 1 .css & 1 .js
1 .js 1 .js 2 .js Twitter Bootstrap Slider Parallax jQuery Backbone
None
None
None
None
None
None
None
None
<html> <head> <link rel="stylesheet" href="css/bootstrap.css"> <link rel="stylesheet" href="css/slider.css"> <link rel="stylesheet"
href="css/custom.css"> </head> <body> ... <script src="js/jquery.js"></script> <script src="js/jquery.parallax.js"></script> <script src="js/jquery.slider.js"></script> <script src="js/bootstrap.js"></script> <script src="js/underscore.js"></script> <script src="js/backbone.js"></script> <script src="js/application.js"></script> </body> </html>
seriously?
! No braço!
seriously?
None
GRUNT The JavaScript Task Runner
module.exports = function(grunt) { grunt.initConfig({ pkg: grunt.file.readJSON('package.json'), concat: {
options: { separator: ';' }, dist: { src: ['src/**/*.js'], dest: 'dist/<%= pkg.name %>.js' } }, uglify: { options: { banner: '/*! <%= pkg.name %> <%= grunt.template.today("dd-mm-yyyy") %> */\n' }, dist: { files: { 'dist/<%= pkg.name %>.min.js': ['<%= concat.dist.dest %>'] } } }, qunit: { files: ['test/**/*.html'] }, jshint: { files: ['Gruntfile.js', 'src/**/*.js', 'test/**/*.js'], options: { // options here to override JSHint defaults globals: { Gruntfile.js
files: ['test/**/*.html'] }, jshint: { files: ['Gruntfile.js', 'src/**/*.js', 'test/**/*.js'], options:
{ // options here to override JSHint defaults globals: { jQuery: true, console: true, module: true, document: true } } }, watch: { files: ['<%= jshint.files %>'], tasks: ['jshint', 'qunit'] } }); grunt.loadNpmTasks('grunt-contrib-uglify'); grunt.loadNpmTasks('grunt-contrib-jshint'); grunt.loadNpmTasks('grunt-contrib-qunit'); grunt.loadNpmTasks('grunt-contrib-watch'); grunt.loadNpmTasks('grunt-contrib-concat'); grunt.registerTask('test', ['jshint', 'qunit']); grunt.registerTask('default', ['jshint', 'qunit', 'concat', 'uglify']); }; Gruntfile.js
seriously?
gulp.js The streaming build system
Streams Modular API Simples Rápido
Streams Unix pipes no Node.js
Streams Unix pipes no Node.js Facilita composição e reuso
Streams Unix pipes no Node.js Facilita composição e reuso Assíncrono
sem callback hell
Streams Unix pipes no Node.js Facilita composição e reuso Assíncrono
sem callback hell stream1.pipe(stream2)
Modular Pequenos plugins
Modular Pequenos plugins "do one thing and do it well"
Modular Pequenos plugins "do one thing and do it well"
Orientações rígidas
Modular Pequenos plugins "do one thing and do it well"
Orientações rígidas require('gulp-module')
API Simple gulp.task(…)
API Simple gulp.task(…) gulp.src(…)
API Simple gulp.task(…) gulp.src(…) gulp.dest(…)
API Simple gulp.task(…) gulp.src(…) gulp.dest(…) gulp.watch(…)
Rápido Perfeito para "watch"
Rápido Perfeito para "watch" Assíncrono FTW"
Rápido Perfeito para "watch" Assíncrono FTW" Assíncrono WTF#
Live Coding (hopefully)
Thanks! @samflores