From 9a9110aabc9579ee85e4778ff5e10df1ac7b9715 Mon Sep 17 00:00:00 2001 From: Sait KURT <33868586+xDeSwa@users.noreply.github.com> Date: Fri, 11 Jul 2025 12:35:26 +0300 Subject: [PATCH 1/3] Missing 'importmap:remove' command --- frontend/asset_mapper.rst | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/frontend/asset_mapper.rst b/frontend/asset_mapper.rst index 454e13a1d29..22bb169169c 100644 --- a/frontend/asset_mapper.rst +++ b/frontend/asset_mapper.rst @@ -301,6 +301,35 @@ You can update your third-party packages to their current versions by running: $ php bin/console importmap:update bootstrap lodash $ php bin/console importmap:outdated bootstrap lodash +Removing Packages from importmap +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +If you need to remove a JavaScript package that was previously added to your ``importmap.php`` file, you can use the ``importmap:remove`` command. + +.. code-block:: terminal + + $ php bin/console importmap:remove + +For example, to remove the ``lodash`` package from your importmap: + +.. code-block:: terminal + + $ php bin/console importmap:remove lodash + +This will update your ``importmap.php`` file and remove the specified package (and any dependencies added along with it). +After running this command, it is recommended to also run: + +.. code-block:: terminal + + $ php bin/console importmap:install + +This ensures your ``assets/vendor/`` directory is in sync with the updated importmap configuration. + +.. tip:: + + Removing a package from the importmap does not automatically remove any references to it in your JavaScript files. + Make sure to update your code to remove any ``import`` statements that reference the removed package. + How does the importmap Work? ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ From 32c2af176e6916773e5c7c13e2d8c594b9b13df7 Mon Sep 17 00:00:00 2001 From: Sait KURT <33868586+xDeSwa@users.noreply.github.com> Date: Fri, 11 Jul 2025 12:41:22 +0300 Subject: [PATCH 2/3] Update asset_mapper.rst --- frontend/asset_mapper.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/asset_mapper.rst b/frontend/asset_mapper.rst index 22bb169169c..d67f2a76cd3 100644 --- a/frontend/asset_mapper.rst +++ b/frontend/asset_mapper.rst @@ -316,7 +316,7 @@ For example, to remove the ``lodash`` package from your importmap: $ php bin/console importmap:remove lodash -This will update your ``importmap.php`` file and remove the specified package (and any dependencies added along with it). +This will update your ``importmap.php`` file and remove the specified package (and any dependencies added along with it). After running this command, it is recommended to also run: .. code-block:: terminal From c3f8980ee6dfdd481361dbdef1f7f867a5884ca0 Mon Sep 17 00:00:00 2001 From: Sait KURT <33868586+xDeSwa@users.noreply.github.com> Date: Fri, 11 Jul 2025 12:42:12 +0300 Subject: [PATCH 3/3] Update asset_mapper.rst --- frontend/asset_mapper.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/asset_mapper.rst b/frontend/asset_mapper.rst index d67f2a76cd3..8b24723186b 100644 --- a/frontend/asset_mapper.rst +++ b/frontend/asset_mapper.rst @@ -327,7 +327,7 @@ This ensures your ``assets/vendor/`` directory is in sync with the updated impor .. tip:: - Removing a package from the importmap does not automatically remove any references to it in your JavaScript files. + Removing a package from the importmap does not automatically remove any references to it in your JavaScript files. Make sure to update your code to remove any ``import`` statements that reference the removed package. How does the importmap Work?