You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Firstly, thanks for this library.. it feels like the future! It's also been a great intro to ESM and how that works.
We're running into an issue using this together with a Rails engine, because the importmap_helper.rbfile is hardcoded to look in the Rails.root folder only, when resolving the paths for stimulus controllers.
where slideshow_controller resides under the engine.
It would be great if we could specify which root paths to use in this helper, so we can include AppKit::Engine.root in the helper path, for example and have it work automatically.
Would this be a welcome option if we gave it a go for a PR? A bit unsure how best to do it, while also keeping the interface simple like it is now: importmap_list_from(*paths) so open to ideas and suggestions.
The text was updated successfully, but these errors were encountered:
I think we could make this work by having it accept both relative and absolute paths. Relative would work as now, going off Rails.root, but absolute (starting with /) would allow for engines 👍
Firstly, thanks for this library.. it feels like the future! It's also been a great intro to ESM and how that works.
We're running into an issue using this together with a Rails engine, because the
importmap_helper.rb
file is hardcoded to look in theRails.root
folder only, when resolving the paths for stimulus controllers.stimulus-rails/lib/stimulus/importmap_helper.rb
Line 8 in 13383ac
We can work around this by manually adding our engine's stimulus controllers to the importmap.json file like so:
where
slideshow_controller
resides under the engine.It would be great if we could specify which root paths to use in this helper, so we can include
AppKit::Engine.root
in the helper path, for example and have it work automatically.Would this be a welcome option if we gave it a go for a PR? A bit unsure how best to do it, while also keeping the interface simple like it is now:
importmap_list_from(*paths)
so open to ideas and suggestions.The text was updated successfully, but these errors were encountered: