SlideShare une entreprise Scribd logo
1  sur  36
Télécharger pour lire hors ligne
u—s‚øtKtÑ @_kenichirow
÷™¶&gumi
ô çà èà Ôê¼
°ì: HTML,SCSS,CoffeeScript
°ì? : ¤—•«ł› “¦Python
EÛ? : ^ŠClojure Oµ −
vim , git
:Ÿ ¡̃^Š”ô çà èØoìŽ
grunt »
gumi »grunt³ t∙q³›–−v
^Š”gruntRRìŽ̋v
ox¶ß ¡w^Š”ôçà èØo»fiœo
)åa qk aweb¼ö ÍßÓ ” áÞawÒ—œ¶o
Backbone.js¶∙JS”MVCô ߊ ßË
SMACSS¶∙&|oCSSŁSÊ 
ŸÜ»Ã³o—zßÎv•Ufl“¦∙ Ðs−̃ Ø)s¤
ÞߊØo“ ^‘̃”ÈowìáË•
.o«åÒ¾éß•Šo< ØÏþ è ¾ ³ −̀¶w)s¤
ÿÕØIo
Šøa|—|łq1;a x−̃ »Šøa|–²žvœ o|¡
Ø› !”© O¶ )•ÓÂ
GRUNT.JS
GRUNT.JS
Node.js ¢œ©¤¤ÜÕËŠøaâß
Ruby”RakeºJava”Ant œ∼øq¶Ø”
Ïþ è ¾ $ grunt + u ©¤ÜÕËù
grunt.js
$ grunt sass
GRUNT”ïßÔ •fio–gumi »2013 7j‚v”^&⁄v0.4.1 ³³i
0.3Kvœ0.4K v¶ßNòw‾›–o−” Ÿ ä
©–¶oö ̾ »³s¶v›¤ß|—¡ ìáçö”
̂oÏßè»Ó²
̨ : grunt/grunt Upgrading from 0.3 to 0.4
WHO USES GRUNT
cw x−”̇
ÜÕËÀ°ì)³Ł1ô¹¾ Gruntfile.(js/coffee)•̈o–
Ïþ è
×s sass(compass)”Ï ð¾ “›¤œ»
#Gruntfile.coffee
module.exports = (grunt) ->
config =
compass:
debug:
options:
environment: 'development'
release:
options:
environment: 'production'
grunt.loadNpmTasks 'grunt-contrib-compass'
grunt.registerTask 'compile', 'compassコンパイルをするよ (DEBUG)', [
'compass'
]
$ grunt compass:release
¶þ”§Í̆›«Œ¦̃©compass³Ÿ •§z” N°œ
¶o... Î
² » c”ÜÕ˳— Ł–Ñ̃• ¡−
Zî”ô¹¾ ”Nò³{−|–Šø ÜÕË
#release task
grunt.registerTask 'release-compile', 'sassのコンパイルをするよ (RELEASE)', [
'checkConflict' //コンパイルするファイルに未解消のコンフリクトがないかチェック
'clean:sass' //sassの一時ファイルを削除
'compass:release' //コンパイル
'clean:css' //古いcssを削除
'lightpng' //リポジトリに追加された画像を圧縮
'copy:sass' //アプリケーションのフォルダにcssをコピー
'csso' //cssoで最適化
'resizeImage' //画像のリサイズ
'cssImage1x' //android用のcss生成
'growl:sass' //おわったらgrowlで通知
]
$ grunt release-compile
¶þ”§Í ƒ©H”»Ã Ø Ø› »s shell Øoo
oµ∼Œ... Î
|zo
2013 •ÓÂ ÕË öç̈x¤z¶o
N¶DSL̈x¤z¶o
XML»<7”̈z'∼Œ¶o
GRUNTooø©5|µ“JS ÜÕËŠøa!
ö ̾ n Vz1000ıö
coffee+Ô !©”lodash 9c;»Ã›̌z Õç ¢
x−!
ô¹¾ Nò³ç Èß•|– ²”ÜÕ˳̄́|¡”
w–Øq ©¶o
GUMI ”GRUNT
qxz)¦–
coffee/scss”Ï ð¾ iÜÕË
öl•ô^¡−pł |¤ÜÕË
•)v©−
×s ß̋∙Øu¢£|¤ ßÕi•scss³Ï ð¾ ¡
−ÜÕË
#release task
grunt.registerTask 'release-compile', 'sassのコンパイルをするよ (RELEASE)', [
'checkConflict' //コンパイルするファイルに未解消のコンフリクトがないかチェック
'clean:sass' //sassの一時ファイルを削除
'compass:release' //コンパイル
'clean:css' //古いcssを削除
'lightpng' //リポジトリに追加された画像を圧縮
'copy:sass' //アプリケーションのフォルダにcssをコピー
'csso'
//cssoで最適化
'resizeImage' //画像のリサイズ
'cssImage1x' //android用のcss生成
'growl:sass' //おわったらgrowlで通知
]
^Š¢›¤ÜÕË
GRUNT-LIGHTPNG
compass Šø¢{©−sprite«(»32bit”png
̃¡−âß »m−¦∙ À‚> ºß¤z¶o
«(”ò&º g³{−|–Šø ̃¡© ...
git ls-tree ýÔç 唫(”îáә߳<À
gp³}=|–json•|–ZB
$ git ls-tree -r HEAD
{
'foobar1.png':{ 'hash' : 'e1456604d111dd4' },
'foobar2.png':{ 'hash' : 'u12358fffgs84jc' }
}
json ‚v”îáә߳̋Ó¡−
ò&©¤ô¹¾ w°v−” əߕ‾©– ̃
oqÜÕ˳¢ß—|¤
#画像をミニファイするメソッド
minify = ->
file = queue.shift()
unless file
_end()
return
steps = [
->
_exec "./tools/bin/lightpng #{file} -32i #{file}",()->
_next steps.shift()
,->
_next minify
]
_next steps.shift()
o«o«>ø Ïþ è§v¶z–Ø ßÕô•«(
̃¡−øq•¶ß—|¤
Ł ¤|Ł ¤|
t” ̃¬³›–o−ö ÔÂËç»o—” ̃¬2fi
íÁîÁØ—“—“Ä́|–−^ÌÜÕËØ g|–o
›–o−
Šøa»q<c”Þߊ•¶© •¶−̋∙xo–z−Û
î
GRUNTRR”o¬o¬
GRUNT-CONTRIB
Й”ö ̾ j
̃©ıł•Ønpm•u ©¤ÜÕËw1000ıö
https://github.com/gruntjs/grunt-contrib
GRUNT-INIT
grunt³³›¤ö ÔÂË甿¶=³ä ö ßçvœ¢
{¡−âß
ÑvœŠ) ÁŁ−þ »̃©³³q Û
https://github.com/gruntjs/grunt-init
YEOMAN
grunt bower¶∙³ áö|¤ô ߊ ßË
Ïþ èÑo ŽÝ ¶JS¼ö ”ö{w|öw−
Ufl“¦∙YEOMAN way•pqÈowm− ZZö{•|
¤oþ »q‘oþ wIovØ
http://yeoman.io/
— Ł
ß<»»o—|¤ÍÓ ÕË öç»|ÄÎ
Š) ÑvœC ̈z” »¶z ìÚ•H”<ẅo¤Ï
ßè³Ó ÕË öçvœ̄́|¡̃ Ñ Øc−
)”C”Ïßè³ |¤” œ∼앶−
GRUNT = ô çà èåùáð• ›–”|Ä
u°ß’∼÷mßw q’‘o—|¤

Contenu connexe

En vedette

Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsPixeldarts
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthThinkNow
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfmarketingartwork
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Applitools
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at WorkGetSmarter
 

En vedette (20)

Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
 

gumistudy#15 How to Automate Tasks grunt.jsを使ったタスク自動化