paper9oll's avatar

mix is not defined

Hi all,

I'm trying to write an globbing laravel elixir extensions as i would not want to repeated code into various tasks.

However when running gulp i got error stating mix is not defined.

Does anyone know why this is the case?

elixir.extend('sass', function(src, output, input, options) {
    new elixir.Task('sass', function() {
        for(let file of glob.sync(src)) {
            return mix.sass(path.basename(file), output, input, options);
        }
    });
});
0 likes
4 replies
topvillas's avatar

Did you include const mix = require('laravel-mix')

topvillas's avatar

I see. You still to pass mix into the function somehow.

new elixir.Task('sass', function(mix) { ... maybe/

Please or to participate in this conversation.