Skip to content

Commit 149810d

Browse files
committed
Merge branch '7.4' into 8.0
* 7.4: Tweaks [AssetMapper] Missing 'importmap:remove' command
2 parents d025b62 + f84fe39 commit 149810d

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
@@ -293,6 +293,33 @@ You can update your third-party packages to their current versions by running:
293293
$ php bin/console importmap:update bootstrap lodash
294294
$ php bin/console importmap:outdated bootstrap lodash
295295
296+
Removing JavaScript Packages
297+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
298+
299+
If you need to remove a JavaScript package that was previously added to your
300+
``importmap.php`` file, use the ``importmap:remove`` command. For example, to
301+
remove the ``lodash`` package:
302+
303+
.. code-block:: terminal
304+
305+
$ php bin/console importmap:remove lodash
306+
307+
This updates your ``importmap.php`` file and removes the specified package
308+
(along with any dependencies that were added with it).
309+
310+
After running this command, it's recommended to also run the following to ensure
311+
that your ``assets/vendor/`` directory is in sync with the updated import map:
312+
313+
.. code-block:: terminal
314+
315+
$ php bin/console importmap:install
316+
317+
.. tip::
318+
319+
Removing a package from the import map does not automatically remove any
320+
references to it in your JavaScript files. Make sure to update your code and
321+
remove any ``import`` statements that reference the removed package.
322+
296323
How does the importmap Work?
297324
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
298325

0 commit comments

Comments
 (0)