I just did a clean install of laravel. Elixir is not combining my scripts. I am clueless about what's happening. I see the scripts task getting triggered but no files are output in public/js directory.
This is my gulpfile.js:
elixir(function (mix) {
mix.sass('style.scss')
.scripts([
'vendor/jquery.js',
'vendor/foundation.min.js',
'script.js'
], 'resources/assets/js', 'public/js/app.min.js')
.scripts([
'vendor/modernizr.js'
], 'resources/assets/js', 'public/js/modernizr.js');
});
It compiles sass properly.
This is the directory structure: https://www.uploady.com/#!/download/221Y0RI_aYe/V7eKiQHIw2gvyXVD
I found the answer. My second and third argument (input and output directory) to the scripts() function should be interchanged. Seems like this changed in the current version of elixir. Happy coding!
Edit (solution):
elixir(function (mix) {
mix.sass('style.scss')
.scripts([
'vendor/jquery.js',
'vendor/foundation.min.js',
'script.js'
], 'public/js/app.min.js', 'resources/assets/js')
.scripts([
'vendor/modernizr.js'
], 'public/js/modernizr.js', 'resources/assets/js');
});
I found a similar question here: laracast.com
The problem was that the version of laravel-elixir was not the latest version.
So have a look in your package.json and check which version you are running.
Maybe your problem is also the version you use for laravel-elixir.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With