javascript - How to compile less in multiple folders using gulp
滿天的星座
滿天的星座 2017-06-12 09:30:02
0
2
650

The project directory is as shown:

The 2015, 2016, and 2017 folders are at the same level as gulpfile.js, package, and node_module.
I want to automatically compile the less files in each folder and generate them in their respective css folders. Then the code I wrote is as follows:

var gulp = require('gulp'),
    less = require('gulp-less');

//LESS编译任务
gulp.task('less', function () {
    gulp.src('./*/less/*.less')
        .pipe(less())
        .pipe(gulp.dest('./*/css'));
});

gulp.task('default', function () {
    gulp.watch('./*/less/*.less', ['less']);
});

How should I modify it?

滿天的星座
滿天的星座

reply all(2)
滿天的星座

gulp.src('./**/less/*.less'), or you can pass an array.

巴扎黑

You can create a task and then use run-sequence

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!