Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[AssetMapper] importmap() function imports all entry points #54377

Open
@jmariller

Description

@jmariller

Symfony version(s) affected

7.0.0

Description

So I am not sure if this is really a bug or if it is intended to work like this, but when using the AssetMapper function importmap() with a given entrypoint, I would expect not to see other entrypoints defined in importmap.php to be part of the compiled <script type="importmap">.

How to reproduce

  1. Add a few entrypoints in importmap.php (for example login.js, admin.js, app.js)
  2. Use one of the entrypoints in a twig template, like so: {% block importmap %}{{ importmap('login') }}{% endblock %}
  3. When looking into the generated source I can see in <script type="importmap"> not only an entry for login.js but for all entrypoints

Possible Solution

No response

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions