File tree Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Original file line number Diff line number Diff line change @@ -279,6 +279,35 @@ You can update your third-party packages to their current versions by running:
279
279
The ``importmap:install `` and ``importmap:outdated `` commands were introduced
280
280
in Symfony 6.4.
281
281
282
+ Removing Packages from importmap
283
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
284
+
285
+ If you need to remove a JavaScript package that was previously added to your ``importmap.php `` file, you can use the ``importmap:remove `` command.
286
+
287
+ .. code-block :: terminal
288
+
289
+ $ php bin/console importmap:remove <package>
290
+
291
+ For example, to remove the ``lodash `` package from your importmap:
292
+
293
+ .. code-block :: terminal
294
+
295
+ $ php bin/console importmap:remove lodash
296
+
297
+ This will update your ``importmap.php `` file and remove the specified package (and any dependencies added along with it).
298
+ After running this command, it is recommended to also run:
299
+
300
+ .. code-block :: terminal
301
+
302
+ $ php bin/console importmap:install
303
+
304
+ This ensures your ``assets/vendor/ `` directory is in sync with the updated importmap configuration.
305
+
306
+ .. tip ::
307
+
308
+ Removing a package from the importmap does not automatically remove any references to it in your JavaScript files.
309
+ Make sure to update your code to remove any ``import `` statements that reference the removed package.
310
+
282
311
How does the importmap Work?
283
312
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
284
313
You can’t perform that action at this time.
0 commit comments