Grunt Learning Essays

Source: Internet
Author: User

1 Grunt Installing the global installation NPM install-g GRUNT-CLI

2 configuration package.json and Gruntfile files, these two files must be located under the project root directory.

Package.json Configuration Instance

1 {2"Name": "Web",3"Version": "2.1.0",4"description": "A simple UI Framework based on Zepto",5"Author": "Vistim",6"License": "BSD",7"Readmefilename": "Readme.md",8"Devdependencies": {9"Connect-livereload": "Latest",Ten"Grunt": "^1.0.1", One"Grunt-contrib-concat": "^1.0.1", A"Grunt-contrib-connect": "^1.0.2", -"Grunt-contrib-copy": "^1.0.0", -"Grunt-contrib-imagemin": "^0.8.1", the"Grunt-contrib-jshint": "^0.12.0", -"Grunt-contrib-less": "^1.3.0", -"Grunt-contrib-livereload": "^0.1.2", -"Grunt-contrib-uglify": "^1.0.1", +"Grunt-contrib-watch": "^1.0.0", -"Grunt-jsbint": "0.0.7", +"Grunt-size": "^0.1.2", A"grunt-targethtml": "^0.2.6", at"Grunt-tmod": "^0.2.10" -   } -}

3 Running Grunt

Move the current directory of the command line to the project's root directory. Command-line operation "CD" + path enter into the directory. Access to desktop via CD desktop

Executes npm install the library that the Command installation project relies on. (can be automatically installed directly according to the configuration file)

Executes the grunt command.

4 grunt commonly used plug-in function (in Package.json there is the use of plug-in list and version number)

Contrib-jshint--javascript syntax error checking;

contrib-watch--real-time monitoring file changes, call the corresponding task re-execution;
contrib-clean--empty files and folders;
contrib-uglify--compressing JavaScript code
contrib-copy--Copying files, folders
contrib-concat--merging multiple files into a single file
karma--front-end automated testing tools

Grunt Learning Essays

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.