8000 [AssetMapper] Put importmap in polyfill so it can be hosted locally e… · symfony/symfony-docs@f343237 · GitHub
[go: up one dir, main page]

Skip to content

Commit f343237

Browse files
[AssetMapper] Put importmap in polyfill so it can be hosted locally easily
1 parent 80f7c9e commit f343237

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
@@ -1031,15 +1031,31 @@ you expect are being included in the asset map.
10311031
``framework.asset_mapper.importmap_polyfill``
10321032
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
10331033

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

10371038
.. code-block:: yaml
10381039
10391040
framework:
10401041
asset_mapper:
10411042
importmap_polyfill: false # disable the shim ...
1042-
# importmap_polyfill: 'https://...' # ... or pass some custom URL
1043+
# importmap_polyfill: 'my_import_map' # ... or pass an importmap name
1044+
1045+
.. tip::
1046+
1047+
You can tell the AssetMapper to load the `ES module shim`_ locally by
1048+
using the following command, without changing your configuration:
1049+
1050+
.. code-block:: terminal
1051+
1052+
$ php bin/console importmap:require es-module-shims
1053+
1054+
.. versionadded:: 6.4
1055+
1056+
Passing an importmap name in ``importmap_polyfill`` was
1057+
introduced in Symfony 6.4. Prior to this, you could pass ``false``
1058+
or a custom URL to load the polyfill.
10431059

10441060
``framework.asset_mapper.importmap_script_attributes``
10451061
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

0 commit comments

Comments
 (0)
0