gulp watch not watching imported less files

367 views Asked by At

i'm using Laravel 5.1, which ships with laravel elixir - a wrapper for gulp.

My gulpfile.js looks like this:

var elixir = require('laravel-elixir');

elixir(function(mix) {
    mix.less('app.less');
});

And app.less looks like this:

@import "../bootstrap/less/bootstrap.less";
@import "variables";

I'm running gulp watch from the command line, but the problem is that it only reacts when changes are made to app.less and not the imported files (e.g. bootstrap.less).

How can I enable gulp watch to watch imported files also?

Thanks

1

There are 1 answers

0
spooky On

Turns out that because ../bootstrap/less/bootstrap.less is above the root folder being watched, then it is not watched, despite it being included.

gulp watch watches all assets in the folder, it doesn't read the less files for includes.