Silly question of the day: I am trying to include a swiper js library in my bedrock project. I thought it might be a good idea to check whether it is available on Packagist to include it in my project libraries.
I found it (nolimits4web/swiper - Packagist), included it with my composer.json and got stuck in the following step: load the js files in my theme
I tried to load with a classic enqueue script but can’t manage to build the path to the vendor dir. As I am not very familiar with Composer yet, I thought I might be missing something, any ideas?
Composer is for managing PHP packages. It looks like Swiper is a JavaScript library, so it might make more sense to install it with yarn or npm in your theme. Then you should be able to import or require it in your theme’s JavaScript and it’ll get pulled in by the build process. The docs have a little more information about how this process works: https://roots.io/sage/docs/theme-development-and-building/