Install node. js
Brew Install node. js
Installing grunt
npm install -g grunt-cli
1. New Package.json, configuring
{ "name": "domain.com", "version": "0.1.0", "Devdependencies": { "grunt": "~0.4.1", " Grunt-contrib-csslint ":" ~0.4.0 ", " Grunt-contrib-jshint ":" ~0.11.1 ", " Grunt-contrib-concat ":" ~0.5.1 ", "Grunt-contrib-cssmin": "~0.12.2", "grunt-contrib-uglify": "~0.8.0", "grunt-contrib-imagemin": "~ 0.9.4 ", " Grunt-contrib-watch ":" ~0.5.0 " }}
2. Installing with sudo npm install
3. Write the Gruntfile.js file to verify the merge compression
4. Execute Grunt Command
Attached: Sea.js modular code, grunt packaging Https://www.npmjs.com/package/grunt-cmd-combo
Compress Picture: Smushit img (not useful)---grunt-contrib-imagemin this plugin works
Grunt Plugin Address: http://gruntjs.com/plugins
Reference Blog: http://www.cnblogs.com/yexiaochai/p/3603389.html
A summary of the installation run Grunt build tool on Mac (i)