Skip to content

Commit b952ee2

Browse files
committed
Merge branch '6.4' into 7.0
* 6.4: [AssetMapper] Remove `--download` option that has become obsolete
2 parents 21a31a3 + 49146be commit b952ee2

File tree

1 file changed

+17
-18
lines changed

1 file changed

+17
-18
lines changed

frontend/asset_mapper.rst

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -196,9 +196,9 @@ this can be done by importing its full URL, like from a CDN:
196196
197197
import { Alert } from 'https://cdn.jsdelivr.net/npm/[email protected]/+esm';
198198
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`_:
202202

203203
.. code-block:: terminal
204204
@@ -215,30 +215,29 @@ This adds the ``bootstrap`` package to your ``importmap.php`` file::
215215
],
216216
];
217217

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:
219228

220229
.. code-block:: javascript
221230
222231
import { Alert } from 'bootstrap';
223232
// ...
224233
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:
226237

227238
.. code-block:: terminal
228239
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
242241
243242
You can check for available updates for your third-party packages by running:
244243

0 commit comments

Comments
 (0)