Skip to content

Commit 97681b7

Browse files
[AssetMapper] Replace ImportMapConfigReader by interface
1 parent 3acb0c5 commit 97681b7

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

frontend/asset_mapper.rst

+17
Original file line numberDiff line numberDiff line change
@@ -955,6 +955,23 @@ 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 or use a custom one from a 3rd party package. You can do this by creating a service that implements ``ImportMapConfigReaderInterface`` and then setting the ``config_reader_id`` option:
962+
963+
.. code-block:: yaml
964+
965+
framework:
966+
asset_mapper:
967+
config_reader_id: App\MyCustomImportMapConfigReader
968+
969+
.. tip::
970+
971+
Don't forget to define your service in your ``services.yaml`` file if further configuration is needed.
972+
973+
974+
958975
Page-Specific CSS & JavaScript
959976
------------------------------
960977

0 commit comments

Comments
 (0)