Skip to content

Commit 687bb20

Browse files
committed
[AssetMapper] Replace ImportMapConfigReader by interface
1 parent 3acb0c5 commit 687bb20

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

frontend/asset_mapper.rst

+22
Original file line numberDiff line numberDiff line change
@@ -955,6 +955,28 @@ rendered by the ``{{ importmap() }}`` Twig function:
955955
importmap_script_attributes:
956956
crossorigin: 'anonymous'
957957
958+
``framework.asset_mapper.config_reader_id``
959+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
960+
961+
Sometimes you may want to create your own config reader to load your importmap
962+
or use a custom one from a third party package. You can do this by creating
963+
a service that implements ``ImportMapConfigReaderInterface`` and then setting
964+
the ``config_reader_id`` option:
965+
966+
.. versionadded:: 7.1
967+
968+
The ``framework.asset_mapper.config_reader_id`` was introduced in Symfony 7.1.
969+
970+
.. code-block:: yaml
971+
972+
framework:
973+
asset_mapper:
974+
config_reader_id: App\MyCustomImportMapConfigReader
975+
976+
.. tip::
977+
978+
Don't forget to define your service in your ``services.yaml`` file if further configuration is needed.
979+
958980
Page-Specific CSS & JavaScript
959981
------------------------------
960982

0 commit comments

Comments
 (0)