- Issue created by @bunthorne
- Status changed to Postponed: needs info
11 months ago 8:51am 15 January 2024 - π«π·France Grimreaper France π«π·
Hi,
Manual installation:
You can also place the Bootstrap library in the "libraries" folder manually by downloading and extracting it, if you want.
Composer CLI:
With
composer config
you can edit your composer.json with the command line if you do not want to edit your composer.json file manually, see https://getcomposer.org/doc/03-cli.md#config. So, all the changes to do in the composer.json file documented in the README.md can be done with CLI.If you want to try with CLI and provide the commands you executed, this can be used to update the README.md, or the installation instructions could be put into drupal.org documentation pages for easier editing by any contributors.
New dependency:
I do not want to introduce new dependency to stick as much as possible to Composer and avoid introducing drupalism. If you want you can provide examples of such themes or components that loads the library for evaluation.
- πΊπΈUnited States bunthorne
drupal/bootstrap5 loads 2 versions of the bootstrap library directly into the theme's dist/bootstrap5/[version#] path.
drupal/bootstrap_barrio also has a method of loading the libraries through a composer command as well as using a CDN.I'll attempt the method described in the installation instructions to update my composer.json.
- π«π·France Grimreaper France π«π·
Note to myself: update README to not use bower-asset anymore but npm-asset.
- πΊπΈUnited States bunthorne
getbootstrap.org offers a method for downloading the libraries with composer:
Composer
You can also install and manage Bootstrapβs Sass and JavaScript using Composer:
composer require twbs/bootstrap:5.3.2
- Assigned to Grimreaper
- Merge request !160Issue #3409483 by Grimreaper, bunthorne: Recompile CSS of the subtheme... β (Merged) created by Grimreaper
- Issue was unassigned.
- Status changed to Fixed
11 months ago 1:01pm 18 January 2024 - π«π·France Grimreaper France π«π·
I have created a MR with updated instructions.
https://getbootstrap.com/docs/5.3/getting-started/download/#composer: The problem is that the composer package is by default place in the vendor folder, not in the libraries folder.
I re-tried with stuff like that in composer.json to try to have that moved into the libraries folder without success:
"installer-paths": { ... "app/libraries/bootstrap": [ "twbs/bootstrap" ], ...
"installer-paths": { ... "app/libraries/{$name}": [ "twbs/bootstrap", "type:drupal-library", "type:bower-asset", "type:npm-asset" ], ...
I think this is what I already tried in #3213567: Composer management of the Bootstrap library β .
https://www.drupal.org/project/bootstrap5: β it has commited the Bootstrap library in multiple versions in its repository, we do not want to do that.
https://www.drupal.org/project/bootstrap_barrio: β
- for the composer command: I don't see a specific composer command in the repository. The composer.json requires twbs/bootstrap, so same problem like before.
- in its libraries.yml, the Bootstrap version is hardcoded, same as for https://www.drupal.org/project/bootstrap_library β , with hardcoded list of versions https://git.drupalcode.org/project/bootstrap_library/-/blob/2.0.x/src/Bo...So all have hardcoded versions somewhere and/or the composer package is placed into the vendor directory.
-
Grimreaper β
committed 8c8d8fc1 on 5.0.x
Issue #3409483 by Grimreaper, bunthorne: Recompile CSS of the subtheme...
-
Grimreaper β
committed 8c8d8fc1 on 5.0.x
Automatically closed - issue fixed for 2 weeks with no activity.
- π¬π§United Kingdom kingfisher64
Hello,
I'm struggling to get bootstrap installed/recognised. I installed the libraries module originally and tried:
composer require twbs/bootstrap:5.3.3
however, listing the directories bootstrap isn't found in libraries/bootstrap.I'm getting the following: Could someone offer advice please? Thank you.
Warning: file_get_contents(libraries/bootstrap/dist/js/bootstrap.bundle.min.js): Failed to open stream: No such file or directory in Drupal\system\Controller\JsAssetController->generateHash() (line 43 of core/lib/Drupal/Core/Asset/AssetGroupSetHashTrait.php). Warning: file_get_contents(libraries/bootstrap/dist/js/bootstrap.bundle.min.js): Failed to open stream: No such file or directory in Drupal\Core\Asset\JsCollectionOptimizerLazy->optimizeGroup() (line 175 of core/lib/Drupal/Core/Asset/JsCollectionOptimizerLazy.php). Warning: file_get_contents(libraries/bootstrap/dist/js/bootstrap.bundle.min.js): Failed to open stream: No such file or directory in Drupal\Core\Asset\JsCollectionOptimizerLazy->generateHash() (line 43 of core/lib/Drupal/Core/Asset/AssetGroupSetHashTrait.php).