Hi @vincej
1-Have a look to the error in your browser dev
2-If you think, it's your boorstrap js file, have a look in your brower source for this html page and check if the link points to the correct path
Ok, so I decided to rip all my cdn's out of my header file and import the various JS packages into L8 using npm. One of those is called bootstrap-datepicker and I can not get it to load into my application.
Ok - so I downloaded it and NPM has updated my packages.json file:
"dependencies": {
"bootstrap-datepicker": "^1.9.0",
"moment": "^2.29.1",
"vue": "^2.6.12"
}
I have run npm install, and if I look into the node_modules folder I can see it there.
I also added require('moment') in my resources/app.js file
I have run npm run development
I also have in my header a link: <script src="{{asset('bootstrap-datepicker')}}" defer></script>
Nevertheless, when I run my page I am getting a 404.
Any ideas where I am going wrong?
Many thanks !
The asset() helper is for your own assets (.css/.js/etc) that webpack/mix will compile to your public folder.
You shouldn't be using it to bring in third party libraries.
If you don't want to use a cdn, then you would import it in your bootstrap.js or app.js file and then, if you wish, bind it to the global window object.
Something like this (in bootstrap.js or app.js):
window.bootstrapDatePicker = require('bootstrap-datepicker');
You wouldn't need a script tag for 'bootstrap-datepicker' since mix will compile all the packages imported/required in your app.js file.
Please or to participate in this conversation.