Skip to content

Missing 'importmap:remove' command #21202

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

Open
wants to merge 3 commits into
base: 7.3
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions frontend/asset_mapper.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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 <package>

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?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Expand Down