Gulp-less plugin less file compiled into CSS

Source: Internet
Author: User

Gulp is based on node, so the first step is to make sure you have the node environment installed, how to install it can go to the node website to see (https://nodejs.org/en/)

1.Global buttonGulp

Open the Node window input npm Install-g Gulp

After the global installation, go to the current directory to install the local installation

npm Install--save-dev Gulp

Use the command line when both the global and local project folders are installedgulp–v Check out the versionIf the version is the same, then it's best.

2. Plug-in installation npm Install gulp-less--save-devNPM Install--save-dev gulp-less

NPM Install--save-dev Gulp-watch

After installing the plugin, we will see the file in the directory.

3.gulpfile.js Task Configuration

var gulp = require (' gulp '), less    = require (' gulp-less '),    watch = require (' Gulp-watch ');//Compile our  less Gulp.task (' testless ', function () {    gulp.src (' less/bootstrap.less '). Pipe (less        ())        . Pipe (Gulp.dest (' css/');//output folder-main path}); Gulp.task (' Testwatch ', function () {    gulp.watch (' less/*.less ', [' testless ']); When all less files change, call the Testless task});

  

After configuration, perform the Gulp Testwatch task for less monitoring, and when the less file is modified, the corresponding CSS file will change

Gulp-less plugin less file compiled into CSS

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.