Monday, March 6, 2017

Add jquery on laravel 5.4 mix

I'm already familiar with laravel 5.1 mix (elixir), and recently I decided to test laravel 5.4 mix.

I mixed my libs on vendors files.

mix
.styles([
    './node_modules/bootstrap/dist/css/bootstrap.css',
    './node_modules/font-awesome/css/font-awesome.css'
], 'public/css/vendor.css')
.js([
    './node_modules/jquery/dist/jquery.js',
    './node_modules/bootstrap/dist/js/bootstrap.js',
], 'public/js/vendor.js')
.disableNotifications()
.version();

And included vendor on my page.

<script src="" type="text/javascript" charset="utf-8" async defer></script>

But, when I want use jquery I have this error on image below. Before, in the laravel 5.1 I did exactly that way.

enter image description here

What I have to do?



via Felipe Mathais

Advertisement