Skip to content

Commit f84fe39

Browse files
committed
Merge branch '7.3' into 7.4
* 7.3: Tweaks [AssetMapper] Missing 'importmap:remove' command
2 parents 3cef5c6 + 06a95ad commit f84fe39

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

frontend/asset_mapper.rst

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,33 @@ 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 JavaScript Packages
305+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
306+
307+
If you need to remove a JavaScript package that was previously added to your
308+
``importmap.php`` file, use the ``importmap:remove`` command. For example, to
309+
remove the ``lodash`` package:
310+
311+
.. code-block:: terminal
312+
313+
$ php bin/console importmap:remove lodash
314+
315+
This updates your ``importmap.php`` file and removes the specified package
316+
(along with any dependencies that were added with it).
317+
318+
After running this command, it's recommended to also run the following to ensure
319+
that your ``assets/vendor/`` directory is in sync with the updated import map:
320+
321+
.. code-block:: terminal
322+
323+
$ php bin/console importmap:install
324+
325+
.. tip::
326+
327+
Removing a package from the import map does not automatically remove any
328+
references to it in your JavaScript files. Make sure to update your code and
329+
remove any ``import`` statements that reference the removed package.
330+
304331
How does the importmap Work?
305332
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
306333

0 commit comments

Comments
 (0)