0

I'm on L5, using laravel-elixir and it mysteriously works sometimes but most of the time it doesn't. Gulp is detecting file changes but the new files are unchanged.

Here's my gulpfile.js:

process.env.DISABLE_NOTIFIER = true;

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

elixir(function(mix) {
    mix.less('admin.less')
      .less('app.less')
      .scripts([
         'vendor/isotope/dist/isotope.pkgd.min.js',
         'js/jQuery.neatDataTables.js',
         'vendor/transparency/dist/transparency.min.js',
         'js/app.js',
    ], 'public/js/app.js', 'resources/assets');
});

And this directory structure:

directory structure

Basically, it sometimes works and sometimes it doesn't. It's really frustrating. I've tried running gulp and gulp watch and here is what it outputs:

gulp output

If I change the gulpfile to this though:

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

it seems to work flawlessly.

Petter Thowsen
  • 1,697
  • 1
  • 19
  • 24
  • As an aside, it is not recommend to use `mix.scripts()` with assets that have already been minified. From the docs -> If you intend to concatenate multiple pre-minified vendor libraries, such as jQuery, instead consider using `mix.combine()`. This will combine the files, while omitting the source map and minification steps. As a result, compile times will drastically improve. – Kenneth Stoddard Sep 09 '16 at 00:09

1 Answers1

0

Solved it by merging the two calls to mix.less.

So this:

mix.less(['app.less', 'app.less'])...

Instead of:

mix.less('app.less')
    .less('admin.less')...
Petter Thowsen
  • 1,697
  • 1
  • 19
  • 24