Use of Gulp

Source: Internet
Author: User

First, Introduction

Gulp is a front-end build tool and a build tool similar to grunt, but gulp is lighter, more simple to configure and use, less commands, easier to learn and remember than grunt.

Second, the specific use

  1. Install GULP:NPM Install-g Gulp (Global installation), NPM install--save-dev Gulp (as a dependency on the development project, gulp information is written in devdependenices);
  2. Create a gulpfile.js file in the root directory of the project.
  3. Specific use: First the package to be used to import, and then create a task, for the files that need to be processed to do the appropriate action, and then stored in the specified directory;

Add the appropriate package method: NPM Install Gulp-jshint--save-dev or NPM install Gulp--save or NPM installed Gulp-jshint, all three can be Gulp-jshint installation success, but the difference is --save-dev updates the installed package information to the Devdependenices section in Package.json, and-- Save will write the package information directly into the Package.json dependenices section without adding the package information into the Package.json. At run time, using the command: Gulp, only the default task is executed, no other tasks are performed, and to perform other tasks you need to use the command Gulp [name name] to represent the task executing the specified name; Shows the contents of a Gulpfile.js file:

The following directories are available in the post-execution catalog:

More details can be found in Gulp Chinese web: http://www.gulpjs.com.cn/

Use of Gulp

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.