Gulp compression css,less to CSS, browser real-time Refresh "original"

Source: Internet
Author: User

    • Gulp Getting Started
    • Gulp Browser Real-time synchronization

First to download the corresponding plug-in package;

Gulp-less Package: cnpm Install gulp-less--save-dev

Gulp-connect Package: cnpm Install Gulp-connect--save-dev

GULP-MINIFY-CSS Package: cnpm Install Gulp-minify-css--save-dev

var gulp=require (' Gulp '),    gulp_less=require (' gulp-less '),    gulp_connect=require (' Gulp-connect '),    Gulp_minify_css=require (' gulp-minify-css ');//"Perform multiple Tasks" in a task Gulp.task (' Serves ', function () {    //Create a server, The port defaults    to 8080 gulp_connect.server ({        //root: root        : ' Web ',        livereload:true    });    Dynamic monitoring    Gulp.watch (' web/**/*.* ', [' Reload ', ' less ']); /Deploy Action command-reloadgulp.task (' Reload ', function () {    gulp.src (' web/**/*.* ')        . Pipe (Gulp_connect.reload ());}); /Deploy Action-lessgulp.task (' less ', function () {    gulp.src (' web/less/*.less ')        . Pipe (Gulp_less ())        . PIPE ( Gulp_minify_css ())        . Pipe (Gulp.dest (' web/css/')});

  

Gulp compression css,less to CSS, browser real-time Refresh "original"

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.