Skip to content

Commit 6d40352

Browse files
committed
Merge branch '6.4' into 7.2
* 6.4: Tweaks [AssetMapper] Missing 'importmap:remove' command
2 parents 1e2f25b + a4619de commit 6d40352

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

0 commit comments

Comments
 (0)