Exclude certain assets declared in importmap
I've been trying to make the switch to Propshaft and importmaps for all of my new projects and overall I've really liked it, but there are two issues I haven't been able to figure out quite yet and could use some help.
For Shoelace, I'm trying to use the autoloader script instead of importing everything at once or cherry-picking components. This is my entry for Shoelace in importmap.rb:
pin 'shoelace', to: 'https://cdn.jsdelivr.net/npm/@shoelace-style/[email protected]/cdn/shoelace-autoloader.js'
When trying to use a component, I get an error like this in the console:
GET https://cdn.jsdelivr.net/components/button/button.js net::ERR_ABORTED 404 (Not Found)
The URL should be https://cdn.jsdelivr.net/npm/@shoelace-style/[email protected]/cdn/components/button/button.js, but most of that is being removed, I assume by Propshaft.
For Leaflet, the issue is similar. The map tiles all load properly, but the default marker icons do not. The app tries to load them from the root path (http://localhost:3000/marker-icon.png) instead of the full remote URL.
Does anybody have any tips for how to work around situations like these when using Propshaft and importmaps? Is there a way to exclude certain online paths or assets declared in the importmap from Propshaft?