It has the following functions
Merge JS files Compressed JS file Unit testing (based on QUnit) In a word: automation
Here’s how to install it.
Install node
Refer to the nodejs primer (the latest node will automatically install NPM)
Install the grunt command line tool grunt-cli
Use the -g global installation so you can use it in any directory. Command: NPM install -g grunt-cli
It is important to note that in Linux or MAC sometimes will report no permissions error, in this case must be preceded by a sudo,
After installation, you can view the version of the change tool. Command: grunt -version
Install grunt and its plug-ins
Go to the root directory of a project and use the command NPM install grunt —save-dev
At this point, a review of the grunt version adds a 4.0, as shown below