n s t a l l g u l p - - s a v e - d e v Create and prepare your gulpfile.js t o u c h g u l p f i l e . j s / / I n c l u d e g u l p v a r g u l p = r e q u i r e ( ' g u l p ' ) ;
p m i n s t a l l g u l p - s a s s - - s a v e - d e v n p m i n s t a l l g u l p - a u t o p r e f i x e r - - s a v e - d e v n p m i n s t a l l g u l p - m i n i f y - c s s - - s a v e - d e v
u d e p l u g - i n s v a r s a s s = r e q u i r e ( ' g u l p - s a s s ' ) ; v a r a u t o p r e f i x = r e q u i r e ( ' g u l p - a u t o p r e f i x e r ' ) ; v a r m i n i f y = r e q u i r e ( ' g u l p - m i n i f y - c s s ' ) ;
all the work for us / / C o m p i l e . s c s s , p r e f i x p r o p e r t i e s , m i n i f y t h e C S S g u l p . t a s k ( ' s t y l e s ' , f u n c t i o n ( ) { g u l p . s r c ( [ ' s c s s / * . s c s s ' ] ) . p i p e ( s a s s ) . p i p e ( a u t o p r e f i x ( ' l a s t 2 v e r s i o n s ' ) . p i p e ( m i n i f y ( ) ) . p i p e ( g u l p . d e s t ( ' c s s ' ) ) ; } ) ; Run it! / / R u n o u r C S S t a s k g u l p s t y l e s
/ D e f a u l t g u l p t a s k g u l p . t a s k ( ' d e f a u l t ' , [ ' s t y l e s ' ] ) ; Add multiple tasks g u l p . t a s k ( ' d e f a u l t ' , [ ' s t y l e s ' , ' j s ' ] ) ; Build with one word g u l p
W a t c h f o r . s c s s c h a n g e s g u l p . t a s k ( ' d e f a u l t ' , [ ' s t y l e s ' ] , f u n c t i o n ( ) { g u l p . w a t c h ( ' s c s s / * . s c s s ' , [ ' s t y l e s ' ] ) ; } ) ;
r e q u i r e ( ' g u l p ' ) ; v a r s a s s = r e q u i r e ( ' g u l p - s a s s ' ) ; v a r a u t o p r e f i x = r e q u i r e ( ' g u l p - a u t o p r e f i x e r ' ) ; v a r m i n i f y = r e q u i r e ( ' g u l p - m i n i f y - c s s ' ) ; g u l p . t a s k ( ' s t y l e s ' , f u n c t i o n ( ) { g u l p . s r c ( [ ' s c s s / * . s c s s ' ] ) . p i p e ( s a s s ) . p i p e ( a u t o p r e f i x ( ' l a s t 2 v e r s i o n s ' ) . p i p e ( m i n i f y ( ) ) . p i p e ( g u l p . d e s t ( ' c s s ' ) ) ; } ) ; g u l p . t a s k ( ' d e f a u l t ' , [ ' s t y l e s ' ] , f u n c t i o n ( ) { g u l p . w a t c h ( ' s c s s / * . s c s s ' , [ ' s t y l e s ' ] ) ; } ) ;