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
Getting Started with Gulp.js
Search
Casey Zumwalt
March 05, 2014
Technology
180
5
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Getting Started with Gulp.js
Casey Zumwalt
March 05, 2014
Other Decks in Technology
See All in Technology
取引先から届く 「セキュリティチェックシート」の読み解き方
kamadamakoto
0
140
ボトムアップ文化が強い組織で セキュリティをどう根付かせていくかの現在進行形の話 / Making Security Stick in a Bottom-Up Organization
yamaguchitk333
0
210
Redmine 7.0 新機能・機能強化解説(OSC2026京都ダイジェスト版)
vividtone
1
210
[しろおび夏祭り2026] チャットするAIから、作業するAIへ - 使われ方の変化と、その裏側で起きていること
kk0n
0
1.7k
Sansan Engineering Unit 紹介資料
sansan33
PRO
1
4.9k
事業価値と Engineering 2026年度版
recruitengineers
PRO
45
22k
攻撃と防御で学ぶAI時代のプロダクトセキュリティ演習
recruitengineers
PRO
8
2.2k
20260804_Q4AzureUpdateBite_FabricDataAgentの精度を高める設計.pdf
matayuuu
1
120
ガバメントクラウドでのランサムウェア対策
techniczna
2
1k
【5分でわかる】セーフィー エンジニア向け会社紹介
safie_recruit
0
53k
SmartHR Engineering Team Deck
smarthr
1
1.5k
新しい SLO が良い感じにハマっている話
z63d
5
2.2k
Featured
See All Featured
Measuring Dark Social's Impact On Conversion and Attribution
stephenakadiri
2
250
DBのスキルで生き残る技術 - AI時代におけるテーブル設計の勘所
soudai
PRO
68
56k
What's in a price? How to price your products and services
michaelherold
247
13k
Lightning Talk: Beautiful Slides for Beginners
inesmontani
PRO
2
630
Navigating the moral maze — ethical principles for Al-driven product design
skipperchong
2
470
Automating Front-end Workflow
addyosmani
1370
210k
Getting science done with accelerated Python computing platforms
jacobtomlinson
2
410
Kristin Tynski - Automating Marketing Tasks With AI
techseoconnect
PRO
0
440
Typedesign – Prime Four
hannesfritz
42
3.1k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
32
3k
The Illustrated Guide to Node.js - THAT Conference 2024
reverentgeek
1
420
Building Flexible Design Systems
yeseniaperezcruz
330
40k
Transcript
Getting Started with Gulp.js
Install Node.js 1 nodejs.org
Get to know the command line. 2 ➜ npm -v
Install Gulp globally 3 ➜ sudo npm install -g gulp
Install Gulp globally 3 ➜ gulp -v
Install Gulp locally 4 ➜ cd ~/Casey/Sites/project
Install Gulp locally 4 ➜ project npm init npm init
creates a package.json file in our project directory.
Install Gulp locally 4 ➜ project npm install --save-dev gulp
—save-dev instructs npm to add the dependence to the package.json file we created earlier.
Setting up our Gulpfile 5 WHAT WE NEED GULP TO
DO Lint and concatenate our JavaScript Compile our Sass files Minify and rename everything Reload our browser after each change
Setting up our Gulpfile 5 ➜ project npm install gulp-jshint
gulp-sass gulp-concat gulp-uglify gulp-rename gulp-livereload --save-dev
gulpfile.js // Include gulp var gulp = require('gulp'), ! //
Include Our Plugins jshint = require('gulp-jshint’), sass = require(‘gulp-sass'), concat = require(‘gulp-concat’), uglify = require(‘gulp-uglify'), rename = require(‘gulp-rename’); livereload = require(‘gulp-livereload'); Set up Gulp includes
gulpfile.js // Lint Task gulp.task('lint', function() { return gulp.src('js/*.js') .pipe(jshint())
.pipe(jshint.reporter('default')); }); Set up the Lint task
gulpfile.js // Compile Our Sass gulp.task('sass', function() { return gulp.src('scss/*.scss')
.pipe(sass()) .pipe(gulp.dest('css')); }); Set up the Sass task
gulpfile.js // Concatenate & Minify JS gulp.task('scripts', function() { return
gulp.src('js/*.js') .pipe(concat('main.js')) .pipe(gulp.dest('js')) .pipe(rename('main.min.js')) .pipe(uglify()) .pipe(gulp.dest('js')); }); Concatenate and Minify the JS
gulpfile.js gulp.task('watch', function() { server.listen(35729, function (err) { if (err)
{ return console.log(err) }; ! // Watch .scss files gulp.watch('scss/**/*.scss', ['sass']); ! // Watch .js files gulp.watch('js/**/*.js', ['scripts']); ! }); }); Watch the files and reload the browser when changed
Watch our files for changes 6 ➜ project gulp watch
Add more plugins. 7
Profit. 8