Skip to content

Multiple importmaps #240

Closed
Closed
@manuelmeurer

Description

@manuelmeurer

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::Maps around and delegating Rails.application.importmap to Current.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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions