Gulp: A new generation of front-end building tool

Source: Internet
Author: User
Tags install node

1. What is Gulp

Gulp.js is a next-generation build tool that is stream-based and code-better than configuration.

Gulpand Grunt similar. But compared to Grunt the frequent IO operation of the Gulp flow operation, the build can be completed faster.

2. Gulp characteristics
    • Easy to use

The code is better than the configured strategy to Gulp make simple tasks simple and complex tasks more manageable.

    • Build Fast

Reduce frequent IO operations and build projects faster with streaming operations.

    • High quality plug-in

GulpThere are strict plug-in guidance strategies to ensure that the plug-in can be simple and high-quality work.

    • Easy to learn

A small amount of API, mastering Gulp can be effortless. Build is like a flow pipeline, easy to add pleasure.

3, Gulp Installation

Gulpis based on Node.js , so first install node. js

NPM install-g gulpnpm Install--save-dev Gulp
4, Gulp use

Gulp 's tasks are in the form of plug-ins, and this example takes  gulp-jshint  as an example to show the general use of Gulp .

Installing Gulp-jshint

NPM Install Gulp-jshint--save-dev

create Gulpfile.js

The Gulp project page has one Sample gulpfile . If you can not write, direct reference on the OK.

var gulp = require (' gulp '); var jshint = require (' Gulp-jshint '); var paths = {scripts: ' Js/**/*.js ',};gulp.task (' Lint ', Fu Nction () {return gulp.src (paths.scripts). Pipe (Jshint ()). Pipe (Jshint.reporter (' Default '));});

Then execute the command line

Gulp Lint

Can.

5, Gulp Summary

Gulp   compared to   Grunt   There are many advantages, more intuitive: that is, the learning curve is relatively smooth. Faster and less configuration than grunt.

Gulp has many advanced features, see official documentation

Gulp Plugin List

http://gulpjs.com/


Gulp: A new generation of front-end building tool

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.