I'm trying to compile my LESS files using the gulp-useref plugin, but it is as if the gulp-less plugin never outputs a compiled version of my LESS files in the pipeline. The LESS files get concatenated with the other CSS files without being compiled.
I tried compiling my LESS separately using only gulp-less and it is working well, but I have no idea why it seems to conflict with the gulp-useref plugin.
Here is my gulpfile :
var gulp = require('gulp');
var rm = require('gulp-rimraf');
var gulpif = require('gulp-if');
var less = require('gulp-less');
var cssmin = require('gulp-minify-css');
var useref = require('gulp-useref');
gulp.task('clean', function () {
return gulp.src(['public'])
.pipe(rm({force: true}));
});
gulp.task('refs', ['clean'], function () {
var assets = useref.assets({searchPath: '.'});
return gulp.src(['templates/**/*.html'])
.pipe(assets)
.pipe(gulpif('*.less', less()))
.pipe(gulpif('*.css', cssmin()))
.pipe(assets.restore())
.pipe(gulpif('*.html', useref()))
.pipe(gulp.dest('public/templates'));
});
Thanks in advance for answers!