hi I am using laravel mix to compile all js file but the jquery is not working , even I use defer attribute, can anyone find what is the problem ? thanks
inside webpack.mix.js
// home page css
mix.styles([
'public/app/css/bootstrap.min.css',
'public/app/css/custom.css',
'public/app/css/style.default.css',
'public/app/css/font-awesome.all.css'
], 'public/css/base.css');
// admin css
mix.styles([
'public/assets/css/sb-admin-2.min.css',
'public/app/css/font-awesome.all.css'
], 'public/css/admin.base.css');
mix.autoload({
jquery: ['$', 'window.jQuery', 'jQuery'],
});
// admin js
mix.js([
'public/assets/js/jquery.min.js',
'public/assets/js/bootstrap.bundle.min.js',
'public/assets/js/jquery.easing.min.js',
], 'public/js/admin.lib.js');
inside blade
<!-- <script src="{{asset('assets/js/jquery.min.js')}}"></script>
<script src="{{asset('assets/js/bootstrap.bundle.min.js')}}"></script>
<script src="{{asset('assets/js/jquery.easing.min.js')}}"></script> -->
<script src="{{asset('js/admin.lib.js')}}" defer></script>
<script src="{{asset('assets/js/sb-admin-2.min.js')}}"></script>
I tried
mix.autoload({
jquery: ['$', 'window.jQuery', 'jQuery'],
});
not working , tried to add $=jQuery inside lib.js but fails jquery was working
if I do not use the the compiled lib.js
what is the error I am facing is the $ not defined thanks btw , the css compilation is working though