Home >Web Front-end >JS Tutorial >Installation of building web programs using GruntJS_javascript skills

Installation of building web programs using GruntJS_javascript skills

WBOY
WBOYOriginal
2016-05-16 16:46:331327browse

It has the following functions

Merge JS files
Compress JS files
Unit testing (based on QUnit)
In one sentence: complete automation

The following is its installation process.

1. Install node

Refer to getting started with nodejs (the latest node will automatically install npm)

2. Install grunt command line tool grunt-cli

Use -g to install globally, so it can be used in any directory. Command: npm install -g grunt-cli

Installation of building web programs using GruntJS_javascript skills

It should be noted that under linux or mac, an error of no permissions will sometimes be reported. In this case, a sudo must be added in front,

Installation of building web programs using GruntJS_javascript skills

After installation, you can check the version of the tool. Command: grunt -version

Installation of building web programs using GruntJS_javascript skills

3. Install grunt and its plug-ins

Enter the root directory of a project and use the command: npm install grunt --save-dev

Installation of building web programs using GruntJS_javascript skills

Installation of building web programs using GruntJS_javascript skills
At this time, if you check the grunt version, there will be an additional 4.0, as follows

Installation of building web programs using GruntJS_javascript skills

At this point, the installation is complete.

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn