diff --git a/frontend/asset_mapper.rst b/frontend/asset_mapper.rst index 57a88f77f23..648b158ebb1 100644 --- a/frontend/asset_mapper.rst +++ b/frontend/asset_mapper.rst @@ -289,17 +289,27 @@ Preloading and Initializing "app.js" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In addition to the importmap, the ``{{ importmap() }}`` Twig function also renders -an `ES module shim`_ and a few other things, like a set of "preloads": +an `ES module shim`_ by default. You can configure this in your ``config/packages/asset_mapper.yaml`` +configuration file: -.. code-block:: html +.. code-block:: yaml - - + framework: + asset_mapper: + importmap_polyfill: false # disable the shim ... + # importmap_polyfill: 'https://...' # ... or pass some custom URL In ``importmap.php``, each entry can have a ``preload`` option. If set to ``true``, a ```` tag is rendered for that entry as well as for any JavaScript files it imports (this happens for "relative" - ``./`` or ``../`` - -imports only). This is a performance optimization and you can learn more about below +imports only): + +.. code-block:: html + + + + +This is a performance optimization and you can learn more about below in :ref:`Performance: Add Preloading `. .. _importmap-app-entry: