0

Laravel elixir already comes with bunch of its own dependent node modules. How to use that modules instead of creating dependency in the root package.json.

For example, I want to use "del" package which is already there in /node_modules/laravel-elixir/node_modules/del, so rather than mentioning it on the /package.json, how can use this one?

Dipendra Gurung
  • 5,720
  • 11
  • 39
  • 62

1 Answers1

0

You could try to set up your gulp file like this:

var gulp            = require('gulp'),
    del             = require('del');

gulp.task('default', function() {
});

gulp.task('watch', function() {
    gulp.watch('resources/**', ['default']);
    elixir(function(mix) {
        //Standard elixir code
    });
});

Do note typing $ gulp in cli won't do anything anymore, unless you define something in the default task. $ gulp watch will work as always though.

I have no idea if this works without first requiring the dependency in package.json, but give it a try :)

MartinJH
  • 2,590
  • 5
  • 36
  • 49