I couldn't find a guide that explains how to configure a #rubygem so you can #importmap JS files into your #rails app, when the JS is in a gem.

So I wrote a blogpost on it!
https://www.eirvandelden.com/developing/2024/02/13/importmap-js-from-a-gem.html

Credit goes to Alex on Stack overflow https://stackoverflow.com/users/207090/alex
If anyone knows who he is on, please mention him, because I could not have figured this out without his awesome and very complete answers!

Import JS files from a Gem, `using importmap-rails`

Rails has been going through a lot of changes throughout the years, especially the frontend. Where once Sprockets was “good” enough, we eventually needed a J...

@eirvandelden very good topic :) I was looking for something like this a while back. Thank you for writing about it
@lucian @eirvandelden You’re welcome! I was also looking for it but couldn’t find a complete guide.
I hope it will help someone, at least I now have a better understanding of how `importmap-rails` works ☺️