Skip to content

Commit 9a9110a

Browse files
authored
Missing 'importmap:remove' command
1 parent 2755d65 commit 9a9110a

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
@@ -301,6 +301,35 @@ You can update your third-party packages to their current versions by running:
301301
$ php bin/console importmap:update bootstrap lodash
302302
$ php bin/console importmap:outdated bootstrap lodash
303303
304+
Removing Packages from importmap
305+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
306+
307+
If you need to remove a JavaScript package that was previously added to your ``importmap.php`` file, you can use the ``importmap:remove`` command.
308+
309+
.. code-block:: terminal
310+
311+
$ php bin/console importmap:remove <package>
312+
313+
For example, to remove the ``lodash`` package from your importmap:
314+
315+
.. code-block:: terminal
316+
317+
$ php bin/console importmap:remove lodash
318+
319+
This will update your ``importmap.php`` file and remove the specified package (and any dependencies added along with it).
320+
After running this command, it is recommended to also run:
321+
322+
.. code-block:: terminal
323+
324+
$ php bin/console importmap:install
325+
326+
This ensures your ``assets/vendor/`` directory is in sync with the updated importmap configuration.
327+
328+
.. tip::
329+
330+
Removing a package from the importmap does not automatically remove any references to it in your JavaScript files.
331+
Make sure to update your code to remove any ``import`` statements that reference the removed package.
332+
304333
How does the importmap Work?
305334
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
306335

0 commit comments

Comments
 (0)