I’m using the Jumpstart template.
I have added lightgallery using yarn add lightgallery
In my stimulus controller, I can import the js I need
import lightGallery from 'lightGallery';
import lgThumbnail from 'lightgallery/plugins/thumbnail'
import lgZoom from 'lightgallery/plugins/zoom'
import lgVideo from 'lightgallery/plugins/video'
and in app/assets/stylesheets/application.tailwind.css I can import
Sure. You can use the assets config to add node_modules to the search path for fonts. Depending on how many of these different libraries you end up using, I would consider adding a line per each to your app/assets/config/manifest.js, directing the sprockets to look in the right offset directory. Each one is going to look something like
or maybe leave off fonts and let it figure it out, that might also work. I have adapted this example from getting something out of the vendor directory, so I may not have the correct number of upward jumps in here, but this should get you close.
Are you precompiling your assets? That’s what this configuration is for, it sets up the files in this part of the tree to be fingerprinted and copied into the public/assets tree for your Web server to serve statically.
You may need to do a similar adjustment to your config/initializers/assets.rb file, although I’m not sure that is as important as it used to be in earlier versions of Rails.