Skip to content

Commit dd4cac4

Browse files
committed
[AssetMapper] Missing 'importmap:remove' command
1 parent 6f7c249 commit dd4cac4

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

frontend/asset_mapper.rst

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,35 @@ You can update your third-party packages to their current versions by running:
279279
The ``importmap:install`` and ``importmap:outdated`` commands were introduced
280280
in Symfony 6.4.
281281

282+
Removing Packages from importmap
283+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
284+
285+
If you need to remove a JavaScript package that was previously added to your ``importmap.php`` file, you can use the ``importmap:remove`` command.
286+
287+
.. code-block:: terminal
288+
289+
$ php bin/console importmap:remove <package>
290+
291+
For example, to remove the ``lodash`` package from your importmap:
292+
293+
.. code-block:: terminal
294+
295+
$ php bin/console importmap:remove lodash
296+
297+
This will update your ``importmap.php`` file and remove the specified package (and any dependencies added along with it).
298+
After running this command, it is recommended to also run:
299+
300+
.. code-block:: terminal
301+
302+
$ php bin/console importmap:install
303+
304+
This ensures your ``assets/vendor/`` directory is in sync with the updated importmap configuration.
305+
306+
.. tip::
307+
308+
Removing a package from the importmap does not automatically remove any references to it in your JavaScript files.
309+
Make sure to update your code to remove any ``import`` statements that reference the removed package.
310+
282311
How does the importmap Work?
283312
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
284313

0 commit comments

Comments
 (0)