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
89
株式会社 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
110
Hubot×ChatOps勉強会
ken880guchi
1
1.3k
Other Decks in Technology
See All in Technology
IAMのマニアックな話2025
nrinetcom
PRO
6
1.6k
Linuxのブートプロセス
sat
PRO
6
100
プロダクト開発者目線での Entra ID 活用
sansantech
PRO
0
200
結果的にこうなった。から見える メカニズムのようなもの。
recruitengineers
PRO
1
130
最近のラズピッピいじり / 20250308-rpijam-13th-birthday
akkiesoft
0
130
開発組織を進化させる!AWSで実践するチームトポロジー
iwamot
2
620
2025/3/1 公共交通オープンデータデイ2025
morohoshi
0
120
AI自体のOps 〜LLMアプリの運用、AWSサービスとOSSの使い分け〜
minorun365
PRO
10
1.3k
"TEAM"を導入したら最高のエンジニア"Team"を実現できた / Deploying "TEAM" and Building the Best Engineering "Team"
yuj1osm
1
250
フォーイット_エンジニア向け会社紹介資料_Forit_Company_Profile.pdf
forit_tech
1
1.7k
人生を左右する「即答」のススメ: 一瞬の判断を間違えないためにするべきこと
takasyou
9
1.1k
Amazon Bedrock Knowledge basesにLangfuse導入してみた
sonoda_mj
2
300
Featured
See All Featured
Speed Design
sergeychernyshev
28
820
The Pragmatic Product Professional
lauravandoore
32
6.4k
Building Adaptive Systems
keathley
40
2.4k
Typedesign – Prime Four
hannesfritz
41
2.5k
How STYLIGHT went responsive
nonsquared
99
5.4k
GitHub's CSS Performance
jonrohan
1030
460k
Automating Front-end Workflow
addyosmani
1369
200k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
30
2.3k
Site-Speed That Sticks
csswizardry
4
420
GraphQLの誤解/rethinking-graphql
sonatard
69
10k
Why You Should Never Use an ORM
jnunemaker
PRO
55
9.2k
Stop Working from a Prison Cell
hatefulcrawdad
268
20k
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 ΛࣗΈʹΧελϚ Πζ͠·͠ΐ͏ɻ ࠇ͍ը໘(ίϯιʔϧ)͕ා͍ͳΒΤϯδχΞʹڠྗ
ͯ͠Β͍·͠ΐ͏ɻ ҰਓͰΔͳΒɺ͡Ίਂ͘ߟ͑ͣʹͱΓ͋͑ ࣮ͣߦͯ͠Έ·͠ΐ͏ɻ
ຊ͕Μ͍͖ͬͯ·͠ΐ͏ʂ