rgonzales's avatar

Laravel Elixir 5.3 "mix.combine() is not a function" error

Hello there,

mix.sass() and mix.scripts() tasks are working fine, except the mix.combine() task which throws an error. I'm not sure if I need to add some modules for this task to work. If so, what would be the specific module I need? Below is the only codes I have in my package.json file:

{
  "private": true,
  "devDependencies": {
    "babel-runtime": "^5.8.25",
    "gulp": "^3.9.0",
    "laravel-elixir": "^3.2.8",
    "vue-hot-reload-api": "^1.2.0",
    "vueify-insert-css": "^1.0.0"
  },
  "dependencies": {
    "font-awesome": "^4.5.0",
    "foundation-sites": "^6.3.0",
    "jquery": "^2.2.2",
    "what-input": "^2.0.1"
  }
}
0 likes
9 replies
rgonzales's avatar

This is some part of my gulpfile code @AhimbisibweRoland.

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

var vendor = {
    'jquery': './node_modules/jquery/',
    'whatinput': './node_modules/what-input/'
}

elixir(function(mix) {
    mix.combine([
        vendor.jquery + 'dist/jquery.min.js',
        vendor.whatinput + 'what-input.min.js'
    ], './js/vendor.js');
}
rgonzales's avatar

My bad @AhimbisibweRoland, we're using 5.1 rather . Let me try again the task process.

But may I know if is it possible to update this to 5.3 so I could use the combine process/task?

Anyway I just want to mention that we're working with Statamic Site Template.

Jaytee's avatar

Use the mix.scripts instead for Laravel 5.1

rgonzales's avatar

Thanks @Jaytee. I'm aware of that task. But I have this problem during watch process that gives me an endless loop with scripts. Please see my code below:

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

elixir(function(mix) {
    mix.scripts([
        'js/vendor/vendor1.js',
        'js/vendor/vendor2.js'
    ], './js/vendors.js') // Moves vendor files to js folder
       .scripts([
        'js/scripts/script1.js',
        'js/scripts/script2.js',
        'js/scripts/custom-script.js'
    ], './js/scripts.js') // Moves script files to js folder
       .scripts([
        'js/vendors.js',
        'js/scripts.js'
    ], './js/all.js') // Concatenate all script files
}

What do you think might be the problem here?

rgonzales's avatar

I think I have to post a new thread for this one. What do you think? And is there any way I could delete this post as I just gave a wrong details here.

Please or to participate in this conversation.