Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Grunt

Seb
June 05, 2013

 Grunt

The JavaScript Task Runner

Seb

June 05, 2013
Tweet

Other Decks in Programming

Transcript

  1. G r u n t T h e J a

    v a S c r i p t T a s k R u n n e r
  2. Wh a t ’ s G r u n t

    • J a v a s c r i p t • T a s k s • R u n n e r
  3. Wh y u s i n g G r u

    n t • T o a u t o ma t e • T o U n i t T e s t • T o c h e c k c o d e q u a l i t y • A n d mo r e
  4. H o w 1 . T o i n s

    t a l l , o r e v e n b e t t e r : $ n p m i n s t a l l - g g r u n t { " n a m e " : " J a v a s c r i p t p r o j e c t " , " v e r s i o n " : " 0 . 0 . 1 " , " d e v D e p e n d e n c i e s " : { " g r u n t " : " l a t e s t " } } }
  5. H o w 2 . T o wr i t

    e a t a s k ( i n G r u n t fi l e . c o ff e e ) g r u n t . t a s k . l o a d T a s k s ' g r u n t c o m p o n e n t s / t a s k s ' m o d u l e . e x p o r t s = ( g r u n t ) - > g r u n t . i n i t C o n f i g c o f f e e : j o i n : f i l e s : [ ' ' c o f f e e / 1 . c o f f e e ' ' c o f f e e / 2 . c o f f e e ' ] d e s t : ' j s / 1 2 . j s ' w a t c h : j o i n : f i l e s : ' < % = c o f f e e . j o i n . f i l e s % > ' t a s k s : [ ' t a s k s : [ ' c o f f e e : j o i n ' ] g r u n t . r e g i s t e r T a s k ' d e f a u l t ' , [ ' c o f f e e ' ]
  6. H o w 3 . T o u s e

    g r u n t $ g r u n t R u n n i n g " c o f f e e : j o i n " ( c o f f e e ) t a s k ( . . . ) D o n e , w i t h o u t e r r o r s . $ g r u n t w a t c h R u n n i n g " w a t c h " t a s k W a i t i n g . . . O K W a i t i n g . . . O K D o n e , w i t h o u t e r r o r s . W a i t i n g . . .
  7. • Me r g e a n d mi n

    i f y l e s s t o c s s • Me r g e a n d u g l i f y c o ff e e t o j s • C o d e q u a l i t y a n d c o n v e n t i o n c h e c k o n J a v a s c r i p t • U n i t t e s t t h e j a v a s c r i p t • ma k e a l l o f t h i s o n a b u i l d s e r v e r Wo o R a n k + G r u n t
  8. s e b @wo o r a n k .

    c o m @s e b _ g e e l e n T h a t ’ s i t