@@ -204,6 +204,14 @@ This adds the ``bootstrap`` package to your ``importmap.php`` file::
204204 main package *and * its dependencies. If a package includes a main CSS file,
205205 that will also be added (see :ref: `Handling 3rd-Party CSS <asset-mapper-3rd-party-css >`).
206206
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+
207215Now you can import the ``bootstrap `` package like usual:
208216
209217.. code-block :: javascript
@@ -429,7 +437,10 @@ To include it on the page, import it from a JavaScript file:
429437
430438 Some packages - like ``bootstrap `` - advertise that they contain a CSS
431439 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.
433444
434445Paths Inside of CSS Files
435446~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -1095,3 +1106,4 @@ command as part of your CI to be warned anytime a new vulnerability is found.
10951106.. _sensiolabs/typescript-bundle : https://github.com/sensiolabs/AssetMapperTypeScriptBundle
10961107.. _`dist/css/bootstrap.min.css file` : https://www.jsdelivr.com/package/npm/bootstrap?tab=files&path=dist%2Fcss#tabRouteFiles
10971108.. _`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