I read this page of documentation on how to include a library like JQuery. I proceeded like this:
npm install jquery
npm run dev
Since JQuery didn't become magically available after this, I looked around, and there it is referenced and used in public/js/app.js. So I used the following line in my master layout file, and now I can use JQuery.
<script src="{{asset('js/app.js')}}"></script>
I did not see such a workaround anywhere online, so my question is, am i doing it right? Furthermore I get this error in the Console:
TypeError: window.Laravel is undefined[Learn More] http://localhost/js/app.js:1697:1 webpack_require http://localhost/js/app.js:20:12 http://localhost/js/app.js:778:1 webpack_require http://localhost/js/app.js:20:12 http://localhost/js/app.js:41491:1 webpack_require http://localhost/js/app.js:20:12 http://localhost/js/app.js:66:18 http://localhost/js/app.js:1:11