first of all i know there are plenty of similar questions for this, but none of them solved my problem.
I have app.js:
import $ from 'jquery';
$(document).ready(function () {
...
});
window.$ = $;
and my index.blade.php file:
<html>
<head>
@vite(['resources/js/admin/app.js', 'resources/css/admin/app.css'])
</head>
<body>
...
<script type="text/javascript">
$(document).ready(function() {
// Throws: $ is not defined
});
</script>
</body>
</html>
It never can access jquery. I’ve tried everything. Other libraries work fine but jQuery just don’t.