octogone.dev
octogone.dev

Reputation: 133

Auto compilation of bootstrap less file with gulp/gulp-watch-less does'nt regenerate the css

I've installed nodejs and gulp to auto compile the bootstrap less file (v 3.3.5) with gulp-watch-less module.

Everything is working fine expect one thing: I have to stop and start gulp to regenerate bootstrap.css.

For information, Gulp is detecting that a .less file included in bootstrap.less is modified, I have the following message:

[23:14:40] Starting 'default'...
[23:14:42] Finished 'default' after 2.04 s
[23:16:42] LESS saw variable-overrides.less was changed
[23:16:42] LESS saw variable-overrides.less was changed
[23:16:42] LESS saw bootstrap.less was changed:by:import
[23:16:42] LESS saw bootstrap.less was changed:by:import

But when I open the bootstrap.css file i don’t see the changes until I stop and start gulp again.

Here is the content of my gulpfile.js:

var gulp = require('gulp');
var watchLess = require('gulp-watch-less');
var less = require('gulp-less');

gulp.task('default', function () {
    return gulp.src('./../../../../drupal8/sandbox/felicity/themes/octogone/less/bootstrap.less')
        .pipe(watchLess('./../../../../drupal8/sandbox/felicity/themes/octogone/less/bootstrap.less'))
        .pipe(less())
        .pipe(gulp.dest('./../../../../drupal8/sandbox/felicity/themes/octogone/css'));
});

This code is from gulp-watch-less page

Can some one explain me why the bootstrap.css is not auto-re-generated?

Upvotes: 1

Views: 141

Answers (1)

octogone.dev
octogone.dev

Reputation: 133

I've solved the problem by using gulp-watch-less2

Gulp-watch-less wasn't compatible with gulp 3.9

Upvotes: 1

Related Questions