Skip to content

[AssetMapper] [WCM] Replace ImportMapConfigReader by interface #19407

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

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions frontend/asset_mapper.rst
Original file line number Diff line number Diff line change
Expand Up @@ -955,6 +955,28 @@ rendered by the ``{{ importmap() }}`` Twig function:
importmap_script_attributes:
crossorigin: 'anonymous'

``framework.asset_mapper.config_reader_id``
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Sometimes you may want to create your own config reader to load your importmap
or use a custom one from a third party package. You can do this by creating
a service that implements ``ImportMapConfigReaderInterface`` and then setting
the ``config_reader_id`` option:

.. versionadded:: 7.1

The ``framework.asset_mapper.config_reader_id`` was introduced in Symfony 7.1.

.. code-block:: yaml

framework:
asset_mapper:
config_reader_id: App\MyCustomImportMapConfigReader

.. tip::

Don't forget to define your service in your ``services.yaml`` file if further configuration is needed.

Page-Specific CSS & JavaScript
------------------------------

Expand Down