@@ -200,9 +200,9 @@ this can be done by importing its full URL, like from a CDN:
200
200
201
201
import { Alert } from ' https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/+esm' ;
202
202
203
- But yikes! Needing to include that URL is a pain! Instead, we can add
204
- this to our "importmap" via the ``importmap:require `` command. This command can
205
- be used to download any `npm package `_:
203
+ But yikes! Needing to include that URL is a pain! Instead, we can add this package
204
+ to our "importmap" via the ``importmap:require `` command. This command can be used
205
+ to add any `npm package `_:
206
206
207
207
.. code-block :: terminal
208
208
@@ -219,35 +219,34 @@ This adds the ``bootstrap`` package to your ``importmap.php`` file::
219
219
],
220
220
];
221
221
222
- Now you can import the ``bootstrap `` package like normal:
222
+ .. note ::
223
+
224
+ Sometimes, a package - like ``bootstrap `` - will have one or more dependencies,
225
+ such as ``@popperjs/core ``. The ``importmap:require `` command will add both the
226
+ main package *and * its dependencies.
227
+
228
+ After adding/updating the package in your ``importmap.php `` file, all new packages
229
+ will be downloaded into an ``assets/vendor/ `` directory.
230
+
231
+ Now you can import the ``bootstrap `` package like usual:
223
232
224
233
.. code-block :: javascript
225
234
226
235
import { Alert } from ' bootstrap' ;
227
236
// ...
228
237
229
- If you want to download the package locally, use the ``--download `` option:
238
+ It's recommended to ignore the ``assets/vendor/ `` directory and not commit it to
239
+ your repository. Therefore, you'll need to run the ``php bin/console importmap:install ``
240
+ command to download the files on other computers if some files are missing:
230
241
231
242
.. code-block :: terminal
232
243
233
- $ php bin/console importmap:require bootstrap --download
234
-
235
- This will download the package into an ``assets/vendor/ `` directory and update
236
- the ``importmap.php `` file to point to it. It's recommended to ignore this
237
- directory and not commit it to your repository. Therefore, you'll need to run the
238
- ``php bin/console importmap:install `` command to download the files on other
239
- computers if some files are missing.
244
+ $ php bin/console importmap:install
240
245
241
246
.. versionadded :: 6.4
242
247
243
248
The ``importmap:install `` command was introduced in Symfony 6.4.
244
249
245
- .. note ::
246
-
247
- Sometimes, a package - like ``bootstrap `` - will have one or more dependencies,
248
- such as ``@popperjs/core ``. The ``download `` option will download both the main
249
- package *and * its dependencies.
250
-
251
250
You can check for available updates for your third-party packages by running:
252
251
253
252
.. code-block :: terminal
0 commit comments