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
株式会社 Loco Partners の社内開発 LT 2014年11月18
Search
Kenya Yamaguchi
November 18, 2014
Technology
2
97
株式会社 Loco Partners の社内開発 LT 2014年11月18
2014年11月18日開催
株式会社 Loco Partners の社内開発 LT で Grunt の超入門について発表
Kenya Yamaguchi
November 18, 2014
Tweet
Share
More Decks by Kenya Yamaguchi
See All by Kenya Yamaguchi
はじめよう CakePHP3
ken880guchi
0
400
DevOps勉強会 LT_2014_11_26
ken880guchi
0
120
Hubot×ChatOps勉強会
ken880guchi
1
1.4k
Other Decks in Technology
See All in Technology
[CV勉強会@関東 ICCV2025] WoTE: End-to-End Driving with Online Trajectory Evaluation via BEV World Model
shinkyoto
0
270
Progressive Deliveryで支える!スケールする衛星コンステレーションの地上システム運用 / Ground Station Operation for Scalable Satellite Constellation by Progressive Delivery
iselegant
1
200
[mercari GEARS 2025] なぜメルカリはノーコードを選ばなかったのか? 社内問い合わせ工数を60%削減したLLM活用の裏側
mercari
PRO
0
130
なぜブラウザで帳票を生成したいのか どのようにブラウザで帳票を生成するのか
yagisanreports
0
140
ある編集者のこれまでとこれから —— 開発者コミュニティと歩んだ四半世紀
inao
5
3.4k
[CV勉強会@関東 ICCV2025 読み会] World4Drive: End-to-End Autonomous Driving via Intention-aware Physical Latent World Model (Zheng+, ICCV 2025)
abemii
0
230
やり方は一つだけじゃない、正解だけを目指さず寄り道やその先まで自分流に楽しむ趣味プログラミングの探求 2025-11-15 YAPC::Fukuoka
sugyan
2
840
国産クラウドを支える設計とチームの変遷 “技術・組織・ミッション”
kazeburo
3
1.4k
JAWS-UG SRE支部 #14 LT
okaru
0
110
新しい風。SolidFlutterで実現するシンプルな状態管理
zozotech
PRO
0
110
【M3】攻めのセキュリティの実践!プロアクティブなセキュリティ対策の実践事例
axelmizu
0
170
[mercari GEARS 2025] Keynote
mercari
PRO
1
310
Featured
See All Featured
[RailsConf 2023] Rails as a piece of cake
palkan
57
6.1k
Fantastic passwords and where to find them - at NoRuKo
philnash
52
3.5k
The Language of Interfaces
destraynor
162
25k
Mobile First: as difficult as doing things right
swwweet
225
10k
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
Principles of Awesome APIs and How to Build Them.
keavy
127
17k
Building a Modern Day E-commerce SEO Strategy
aleyda
45
8.1k
The Straight Up "How To Draw Better" Workshop
denniskardys
239
140k
How to Think Like a Performance Engineer
csswizardry
28
2.3k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
140
34k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
666
130k
The Power of CSS Pseudo Elements
geoffreycrofte
80
6.1k
Transcript
GRUNT നଳ
None
࠷ۙͷ WEB ΞϓϦ
࠷ۙͷ WEB ΞϓϦ։ൃ AltJS (CoffeeScript, TypeScript) ͷίϯύΠϧ ֦ு CSS (Sass,
Less, Stylus) ͷίϯύΠϧ JS, CSS ͷ݁߹ͱѹॖ JS, CSS ͷߏจνΣοΫ
(खಈͰ)ͬͯΒΕΔ͔ʁ
͜Μͳͷ͋Γ·͢ɻ
GRUNT ʁ
Node.jsΛ༻ͨ͠ ࣗಈϏϧυπʔϧ
ʁʁʁ
࠷ۙͷ WEB ΞϓϦ։ൃ AltJS (CoffeeScript, TypeScript) ͷίϯύΠϧ ֦ு CSS (Sass,
Less, Stylus) ͷίϯύΠϧ JS, CSS ͷ݁߹ͱѹॖ JS, CSS ͷߏจνΣοΫ ཁ͢Δʹɺ͜ΕΒΛશ෦ GRUNT ͕ࣗಈͰͬͯ͘ΕΔʂ
ͰɺࢲͦΜͳͷ֮͑ͯΔ ࣌ؒͳ͍͠ɻɻɻ ͦΜͳͷΘͳͯ͘ؾ߹͍Ͱख࡞ ۀͰΔ͠ɻɻɻ
None
GRUNT ͜Μͳʹ؆୯ʹ࢝ΊΕΔʂ (ಥʹ࢝·Δ४උखॱ) ࠇ͍ը໘(ίϯιʔϧ)Λ։͍ͯɺ্͔Βॱʹίϐʔ & షΓ ͚ ͔Βͷ Enter!!! cd
~ && mkdir sandbox && mkdir -p sandbox/assets/css && mkdir sandbox/css touch sandbox/assets/css/part1.css && echo "body { background-color: #F2F2F0; }" > sandbox/assets/css/part1.css touch sandbox/assets/css/part2.css && echo "h1 { font-size: 100%; }" > sandbox/assets/css/part2.css
GRUNT ͜Μͳʹ؆୯ʹ࢝ΊΕΔʂ (ಥʹ࢝·Δ४උखॱ) ࠇ͍ը໘(ίϯιʔϧ)Λ։͍ͯɺ্͔Βॱʹίϐʔ & షΓ ͚ ͔Βͷ Enter!!! cd
~ && mkdir sandbox && mkdir -p sandbox/assets/css && mkdir sandbox/css touch sandbox/assets/css/part1.css && echo "body { background-color: #F2F2F0; }" > sandbox/assets/css/part1.css touch sandbox/assets/css/part1.css && echo "h1 { font-size: 100%; }" > sandbox/assets/css/part2.css
GRUNT ͜Μͳʹ؆୯ʹ࢝ΊΕΔ (ಥʹ࢝·ΔΠϯετʔϧखॱ) cd ~/sandbox ruby -e "$(curl -fsSL https://raw.githubusercontent.com/
Homebrew/install/master/install)" brew npm install npm install -g grunt-cli npm install grunt-contrib จࣈ͕Ұഋग़ͯ͘Δ͚ͲɺΠϯ ετʔϥʔͰιϑτΛΠϯετʔϧ ͍ͯ͠ΔΑ͏ͳͷͰ͢ɻ
GRUNT ͜Μͳʹ؆୯ʹ࢝ΊΕΔ (ಥʹ࢝·ΔΠϯετʔϧखॱ) cd ~/sandbox ruby -e "$(curl -fsSL https://raw.githubusercontent.com/
Homebrew/install/master/install)" brew npm install npm install -g grunt-cli npm install grunt-contrib จࣈ͕Ұഋग़ͯ͘Δ͚ͲɺΠϯ ετʔϥʔͰιϑτΛΠϯετʔϧ ͍ͯ͠ΔΑ͏ͳͷͰ͢ɻ
GRUNT ͜Μͳʹ؆୯ʹ࢝ΊΕΔ (࠷ޙͷΠϯετʔϧखॱ) cd ~/sandbox npm init ରܗࣜͰ৭ʑϝοηʔδ͕ग़ͯ͘Δ ͷͰɺͻͨ͢ΒEnterΛ࿈ଧʂʂ
͏ɺΠϯετʔϧऴΘΓɻ
Ͱʁ
ͳʹ͢Μͷʁ
ɹCSS ͷ݁߹Λ GRUNT ʹ खͬͯΒ͍·͠ΐ͏
GRUNT ઃఆखॱ (CSS ͷ݁߹) cd ~/sandbox vi Gruntfile.js module.exports =
function(grunt) { grunt.initConfig({ cssmin: { compress: { files: { 'css/kansei.css': [ 'assets/css/part1.css', 'assets/css/part2.css' ] } } } }); grunt.loadNpmTasks('grunt-contrib-cssmin'); }; ϑΝΠϧͷதʹ ͍ͭ͜Λॻ͖ࠐΜͰอଘ ! ͖ͳΤσΟλͰ ࡞ͯ͠େৎʂ
GRUNT ࣮ߦʂ ! > grunt cssmin
GRUNT ࣮ߦʂ ! > grunt cssmin Running "cssmin:compress" (cssmin) task
File css/kansei.css created: 60 B → 48 B ! Done, without errors. ͳΜ͔Ͱͨʂʂ
͏ɺCSS ݁߹࡞ۀऴΘͬͯ·͢ɻ
GRUNT ͕ੜͨ͠ϑΝΠϧΛ֬ೝ cd ~/sandbox cat css/kansei.css
GRUNT ·ͱΊ ͜ͷଞʹ Grunt ʹศརͳػೳɺ֦ு͕ࢁ͋Γ ·͢ɻ৭ʑௐͯ Gruntfile.js ΛࣗΈʹΧελϚ Πζ͠·͠ΐ͏ɻ ࠇ͍ը໘(ίϯιʔϧ)͕ා͍ͳΒΤϯδχΞʹڠྗ
ͯ͠Β͍·͠ΐ͏ɻ ҰਓͰΔͳΒɺ͡Ίਂ͘ߟ͑ͣʹͱΓ͋͑ ࣮ͣߦͯ͠Έ·͠ΐ͏ɻ
ຊ͕Μ͍͖ͬͯ·͠ΐ͏ʂ