From c9b28f5982469f06840a5038a9d7003a4df1ef6f Mon Sep 17 00:00:00 2001 From: Thomas Landauer Date: Thu, 15 Feb 2024 21:40:47 +0100 Subject: [PATCH] [AssetMapper] Adding infos to be forwarded to package maintainers in case of error Page: https://symfony.com/doc/6.4/frontend/asset_mapper.html#importing-3rd-party-javascript-packages Closes https://github.com/symfony/symfony-docs/issues/19558 --- frontend/asset_mapper.rst | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/frontend/asset_mapper.rst b/frontend/asset_mapper.rst index 110a14d69e0..2df223a779a 100644 --- a/frontend/asset_mapper.rst +++ b/frontend/asset_mapper.rst @@ -188,6 +188,11 @@ to add any `npm package`_: $ php bin/console importmap:require bootstrap +.. note:: + + If you're getting a 404 error, you can contact the package maintainer and ask them to + include `"main":` and `"module":` to the package's `package.json`. + This adds the ``bootstrap`` package to your ``importmap.php`` file:: // importmap.php @@ -207,6 +212,8 @@ This adds the ``bootstrap`` package to your ``importmap.php`` file:: such as ``@popperjs/core``. The ``importmap:require`` command will add both the main package *and* its dependencies. If a package includes a main CSS file, that will also be added (see :ref:`Handling 3rd-Party CSS `). + If the associated CSS file isn't added to the importmap, you can contact the package + maintainer and ask them to include `"style":` to the package's `package.json`. Now you can import the ``bootstrap`` package like usual: