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