- What you need - Node.js and NPM
- Why Grunt?
- Mundane tasks are boring
- Large apps NEED a build process
- Make sure you don't miss things
- Static file server
- Installing Grunt -
npm install grunt -g
- Discuss CLI and Grunt commands (init tasks vs regular/multi tasks)
- Explain built-in tasks
- concat
- init
- lint
- min
- qunit
- server
- test
- watch
- Explain built-in tasks
- Adding it to your project -
grunt init:gruntfile
- Explain init templates and which are available by default
- Go through prompts and explain predefined prompts and defaults
- Explain "fuzzy logic" (lib/src, test/tests/unit/spec)
- Adds grunt.js file to your project
- Examine grunt.js and defaults
- Explain the
default
task
- Explain the
- Adding local and NPM tasks
- http://gruntjs.com/
- Creating a new gruntplugin -
grunt init:gruntplugin
- Templates
grunt.template.process(template, options)
-options.data
passed to templateconfig
- use <% %> style delimiters (default)init
- use {% %} style delimiters (used in init task templates)user
- use [% %] style delimiters (not used internally in grunt)
grunt.template.date(date, format)
andgrunt.template.today(format)
- Discuss the differences between Grunt and Yeoman
- Yeoman is an opinionated version of Grunt (SASS/Compass, Bootstrap, Mocha, RequireJS)
- Many dependencies (curl, git, NodeJS, ruby, RubyGems, Compass, PhantomJS, jpegtran, optipng)
curl -L get.yeoman.io | bash
- Adds Bower for package management
- Adds its own initializers (yeoman, bbb, angular, ember)
- Implements
generators
- like initializers for stubs - Insights/Analytics
- Transitioning to Grunt 0.4
- Gruntfile.js
- Strict mode
- CoffeeScript support
- Bash autocompletion
- No more helpers or directives (use regular Node exports with init function)
- grunt.utils renamed to grunt.util (don't know why)
- Split into many small modules (tasks) - under grunt-contrib-NAME
- Many small task changes
- https://github.com/gruntjs/grunt/blob/devel/docs/migration_guide.mds
phated / dcc_grunt Goto Github PK
View Code? Open in Web Editor NEWOutline for my Desert Code Camp 11.2012 talk about Grunt.js