Gulp Study Notes (i)

Source: Internet
Author: User
Tags install node

Gulp is a NODEJS-based automatic task runner that automates the testing, checking, merging, compressing, formatting, automatic browser refresh, and deployment file generation of JAVASCRIPT/COFFEE/SASS/LESS/HTML/IMAGE/CSS and other files. And listen for files that repeat the specified steps after the change. In the implementation, gulp borrowed from the UNIX operating system pipeline (pipe) thought, the previous level of output, directly into the back-level input, making it very simple to operate.

GULP Installation

Before installing Gulp, install node. js, and then install Gulp globally:

npm install -g gulp

After installation, you can detect the version of Gulp:

After you install gulp globally, you also need to install them separately in each project that you want to use Gulp. Switch the directory to your project folder and execute it on the command line:

npm install gulp

If you want to write gulp into the dependencies of the project Package.json file during installation, you can add –save-dev:

npm install  gulp --save-dev

--save: The configuration information will be saved to Package.json (Package.json is the NODEJS project configuration file. Package.json is a normal JSON file and cannot add any comments. See HTTP://WWW.ZHIHU.COM/QUESTION/23004511);
-DEV/-DEP: Save to Package.json devdependencies node, do not specify-DEV/DEP will be saved to dependencies node.

After installing gulp, you can run NPM init to initialize the Package.json file:

It is important to note that name cannot contain uppercase letters:

After initialization, the Gulpfile.js file needs to be established at the root of the project, and the file name cannot be changed:

Gulp Study Notes (i)

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.