A demo to use GruntJS JavaScript task Runner.
-
Mostly files are already generated on my repo, you can create a empty project, then do it by yourself.
-
Happy Hacking!
- NodeJS
- Use jade to generate dist/index.html
Grunt depends on Node and npm. it's installed globally using npm:
$ npm install -g grunt-cli
$ npm init
Follow the prompt and it will generate package.json
for you.
$ npm install grunt --save-dev
$ npm install grunt-contrib-jade --save-dev
Hint: --save-dev
will auto add installed package to package.json, next time you can simply execute npm i
to install all packages in packages.json
'use strict'
module.exports = function(grunt) {
grunt.initConfig({});
};
$ grunt jade # run both dev and dist
$ grunt jade:dev
$ grunt jade:dist
After prepared all materials, you just need to modify Gruntfile.js and install more dev-depenedncy you need.
$ npm search grunt
$ npm search grunt contrib
$ npm search grunt jade