0

I'm having a little issue with elixir in laravel 5. Sass is working fine, but my scripts are not being moved to the public/js directory neither versioned. here is my gulpfile

 elixir(function(mix) {
 mix.sass('aracademia.scss')
 .scripts(
 [
 'partials/fancybox/jquery.fancybox.pack.js',
 'partials/jscroll.js',
 'aracademia.js',
 'partials/doubletaptogo.js'

 ],
 'resources/assets/scripts',
 'public/js/aracademia.min.js');
 mix.version(['public/css/aracademia.css','public/js/aracademia.min.js']);
 });

Any ideas?

1 Answer 1

2

The problem is probably your paths. In script function as a 2nd parameter you should use destination location (not source) and as 3rd parameter source directory for your script files (and not destination), so in your case:

elixir(function(mix) {
 mix.sass('aracademia.scss')
 .scripts(
 [
 'partials/fancybox/jquery.fancybox.pack.js',
 'partials/jscroll.js',
 'aracademia.js',
 'partials/doubletaptogo.js'

 ], 
 'public/js/aracademia.min.js',
 'resources/assets/scripts'
);
 mix.version(['public/css/aracademia.css','public/js/aracademia.min.js']);
 });

should work assuming you have your js files in resources/assets/scripts directory

Sign up to request clarification or add additional context in comments.

1 Comment

This is really hard to find in the documentation and it looks like the arguments order has changed some point recently. Quite confusing. But thanks for solving this for me too!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.