-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
[AssetMapper] Put importmap in polyfill so it can be hosted locally easily #19057
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[AssetMapper] Put importmap in polyfill so it can be hosted locally easily #19057
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this :).
Configuring this will be rare. However, there IS something that will be much more common, and I'm not sure where to mention it. By default, we output a CDN URL to the polyfill. If a user wants to avoid the CDN ad serve the polyfill locally, the only need to run:
php bin/console importmap:require es-module-shims
No config changes are needed. AssetMapper sees that this is installed locally, and so uses it instead of the CDN. If you have an idea on where we might put that, I'd appreciate it. Even though it doesn't involve actually changing the importmap_polyfill
config, an easy option would be to mention it right in this section.
frontend/asset_mapper.rst
Outdated
@@ -1032,14 +1032,20 @@ you expect are being included in the asset map. | |||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |||
|
|||
Configure the polyfill for older browsers. Default is `ES module shim`_. You can pass | |||
any URL to be included, or ``false`` to disable the polyfill. | |||
an importmap name to load the polyfill, or ``false`` to disable the polyfill loading. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
an importmap name to load the polyfill, or ``false`` to disable the polyfill loading. | |
the key of an item in ``importmap.php`` or ``false`` to disable the polyfill loading. |
frontend/asset_mapper.rst
Outdated
@@ -1032,14 +1032,20 @@ you expect are being included in the asset map. | |||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |||
|
|||
Configure the polyfill for older browsers. Default is `ES module shim`_. You can pass |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Configure the polyfill for older browsers. Default is `ES module shim`_. You can pass | |
Configure the polyfill for older browsers. By default, the `ES module shim`_ is loaded via a CDN. You can pass |
dfc57db
to
f343237
Compare
Thank you for the explanation! I added a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👏
Thank you Alexandre. |
Fix #19032
Friendly ping @weaverryan, my knowledge on the AssetMapper is super limited 😄