-
Notifications
You must be signed in to change notification settings - Fork 118
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Multiple importmaps #240
Comments
I'd also like to see this. Would be very useful for splitting up public/admin JS |
@deanpcmad Feel free to use my fork/branch as described in the PR for now: #241 |
@manuelmeurer that's great. Let me know if you need any help in completing the PR. I would be happy to help. |
@manuelmeurer I have added some comments on the PR. |
I +1 the need for this. To illustrate: javascript_importmap_tags expands to the importmap, the preloads, and the initial module import defined by the provided entry_point parameter. If we passed the entry_point parameter to If this seems agreeable I could throw a PR together. |
Definitely need this. |
Fixed by #253. |
Maybe I'm missing something, but shouldn't it be possible to have multiple separate importmaps? :)
My app has three distinct parts/namespaces ("web" for the public marketing page, "admin" for the admin area, and "clients" for the login area for clients) and for each I'd like to have different pinned (and preloaded) modules.
Right now I'm solving it by keeping three different
Importmap::Map
s around and delegatingRails.application.importmap
toCurrent.importmap
, which loads the correct importmap for the current namespace, but that seems to be much more complicated than it should be.I'm sure I'm not the only one that has multiple distinct namespaces in their app? :)
Is there another way to solve this?
Happy to have a stab at implementing this if it's a welcomed feature.
The text was updated successfully, but these errors were encountered: