More Related Content
Similar to Intro to grunt
Similar to Intro to grunt (20)
Intro to grunt
- 2. 2
A JavaScript Tasks Runner
Uglify JS/CSS
Compile Jade/SASS/Coffeescript
HTML hint
A lot more to explore…
CSS sprite
Intro to Grunt
- 3. Install
$ sudo npm install -g grunt-cli
(1)Based on NodeJS
$ grunt - - version
3
“cli” stands for “Command Line Interface”
- 8. Demo 1: Uglify JS
package.json
$ npm install
OR
$ npm install grunt-contrib-uglify - -save-dev
8
- 13. Demo 2: Adding watch
package.json
$ npm install
OR
$ npm install grunt-contrib-watch - -save-dev
13
- 16. Demo 3: add matchdep
package.json
$ npm install
OR
$ npm install matchdep - -save-dev
16
- 19. Demo 3: compile coffee
package.json
$ npm install
OR
$ npm install grunt-contrib-coffee - -save-dev
19
- 20. Demo 3: compile coffee
gruntfile.js
dest: src
Src
tasks
Let’s watch it!
20
- 23. Demo 4: compile coffee to uglified
gruntfile.js
Customtasknamehere
Let’s watch it!
$ grunt watch
23
- 25. Demo 5: compile sass
package.json
$ npm install
OR
$ npm install grunt-contrib-sass - -save-dev
$ npm install grunt-contrib-cssmin - -save-dev
25