Skip to content

Commit fb645e8

Browse files
committed
feature #19057 [AssetMapper] Put importmap in polyfill so it can be hosted locally easily (alexandre-daubois)
This PR was merged into the 6.4 branch. Discussion ---------- [AssetMapper] Put importmap in polyfill so it can be hosted locally easily Fix #19032 Friendly ping `@weaverryan`, my knowledge on the AssetMapper is super limited 😄 Commits ------- f343237 [AssetMapper] Put importmap in polyfill so it can be hosted locally easily
2 parents 24b7600 + f343237 commit fb645e8

File tree

1 file changed

+19
-3
lines changed

1 file changed

+19
-3
lines changed

frontend/asset_mapper.rst

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -958,15 +958,31 @@ you expect are being included in the asset map.
958958
``framework.asset_mapper.importmap_polyfill``
959959
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
960960

961-
Configure the polyfill for older browsers. Default is `ES module shim`_. You can pass
962-
any URL to be included, or ``false`` to disable the polyfill.
961+
Configure the polyfill for older browsers. By default, the `ES module shim`_ is loaded
962+
via a CDN. You can pass the key of an item in ``importmap.php`` or ``false`` to disable
963+
the polyfill loading.
963964

964965
.. code-block:: yaml
965966
966967
framework:
967968
asset_mapper:
968969
importmap_polyfill: false # disable the shim ...
969-
# importmap_polyfill: 'https://...' # ... or pass some custom URL
970+
# importmap_polyfill: 'my_import_map' # ... or pass an importmap name
971+
972+
.. tip::
973+
974+
You can tell the AssetMapper to load the `ES module shim`_ locally by
975+
using the following command, without changing your configuration:
976+
977+
.. code-block:: terminal
978+
979+
$ php bin/console importmap:require es-module-shims
980+
981+
.. versionadded:: 6.4
982+
983+
Passing an importmap name in ``importmap_polyfill`` was
984+
introduced in Symfony 6.4. Prior to this, you could pass ``false``
985+
or a custom URL to load the polyfill.
970986

971987
``framework.asset_mapper.importmap_script_attributes``
972988
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy