@@ -204,6 +204,14 @@ This adds the ``bootstrap`` package to your ``importmap.php`` file::
204
204
main package *and * its dependencies. If a package includes a main CSS file,
205
205
that will also be added (see :ref: `Handling 3rd-Party CSS <asset-mapper-3rd-party-css >`).
206
206
207
+ .. note ::
208
+
209
+ If you get a 404 error, there might be some issue with the JavaScript package
210
+ that prevents it from being served by the ``jsDelivr `` CDN. For example, the
211
+ package might be missing properties like ``main `` or ``module `` in its
212
+ `package.json configuration file `_. Try to contact the package maintainer to
213
+ ask them to fix those issues.
214
+
207
215
Now you can import the ``bootstrap `` package like usual:
208
216
209
217
.. code-block :: javascript
@@ -429,7 +437,10 @@ To include it on the page, import it from a JavaScript file:
429
437
430
438
Some packages - like ``bootstrap `` - advertise that they contain a CSS
431
439
file. In those cases, when you ``importmap:require bootstrap ``, the
432
- CSS file is also added to ``importmap.php `` for convenience.
440
+ CSS file is also added to ``importmap.php `` for convenience. If some package
441
+ doesn't advertise its CSS file in the ``style `` property of the
442
+ `package.json configuration file `_ try to contact the package maintainer to
443
+ ask them to add that.
433
444
434
445
Paths Inside of CSS Files
435
446
~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -1095,3 +1106,4 @@ command as part of your CI to be warned anytime a new vulnerability is found.
1095
1106
.. _sensiolabs/typescript-bundle : https://github.com/sensiolabs/AssetMapperTypeScriptBundle
1096
1107
.. _`dist/css/bootstrap.min.css file` : https://www.jsdelivr.com/package/npm/bootstrap?tab=files&path=dist%2Fcss#tabRouteFiles
1097
1108
.. _`dynamic import` : https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/import
1109
+ .. _`package.json configuration file` : https://docs.npmjs.com/creating-a-package-json-file
0 commit comments