Kuramo
Kuramo Bootstrap kugirango ubone CSS na JavaScript yakusanyijwe, code yinkomoko, cyangwa uyishyire hamwe nabashinzwe gucunga pake ukunda nka npm, RubyGems, nibindi byinshi.
Byakusanyije CSS na JS
Kuramo biteguye-gukoresha-kode yakozwe kuri Bootstrap v5.0.2 kugirango igabanuke byoroshye mumushinga wawe, urimo:
- Gukusanya no kugabanya CSS bundles (reba dosiye ya CSS igereranya )
- Gukusanya no kugabanya amacomeka ya JavaScript (reba dosiye ya JS igereranya )
Ibi ntabwo bikubiyemo inyandiko, amadosiye yinkomoko, cyangwa JavaScript itabishaka nka Popper.
Amadosiye
Gukusanya Bootstrap hamwe numuyoboro wawe bwite ukuramo isoko Sass, JavaScript, hamwe namadosiye yinyandiko. Ihitamo risaba ibikoresho byinyongera:
- Sass ikusanya yo gukusanya dosiye ya Sass muri dosiye ya CSS
- Autoprefixer kubucuruzi bwa CSS ibanziriza
Ugomba gukenera ibikoresho byuzuye byubaka , zirimo guteza imbere Bootstrap hamwe na doc zayo, ariko birashoboka ko bidakwiriye intego zawe.
Ingero
Niba ushaka gukuramo no gusuzuma ingero zacu , urashobora gufata ingero zimaze kubakwa:
CDN ikoresheje jsDelivr
Kureka gukuramo hamwe na jsDelivr kugirango utange verisiyo ya cashe ya Bootstrap yakozwe CSS na JS kumushinga wawe.
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous">
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" integrity="sha384-MrcW6ZMFYlzcLA8Nl+NtUVF0sA7MsXsP1UyJoMp4YLEuNSfAP+JcXn/tWtIaxVXM" crossorigin="anonymous"></script>
Niba ukoresha JavaScript yacu yakozwe hanyuma ugahitamo gushyiramo Popper ukwayo, ongeramo Popper mbere ya JS yacu, ukoresheje CDN nibyiza.
<script src="https://cdn.jsdelivr.net/npm/@popperjs/[email protected]/dist/umd/popper.min.js" integrity="sha384-IQsoLXl5PILFhosVNubq5LC7Qb9DXgDA9i+tQ8Zj3iwWAwPtgFTxbJ8NT4GN1R8p" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.min.js" integrity="sha384-cVKIPhGWiC2Al4u+LWgxfKTRIcfu0JTxR+EQDz/bgldoEyl4H0zUF0QKbrJ0EcQF" crossorigin="anonymous"></script>
Abashinzwe gupakira
Kurura muri dosiye ya Bootstrap mumasoko hafi ya yose hamwe nabamwe mubayobozi bazwi cyane. Ntakibazo umuyobozi ushinzwe paki, Bootstrap izakenera Sass compiler na Autoprefixer kugirango ushyire hamwe na verisiyo yemewe yatunganijwe.
npm
Shyira Bootstrap muri Node.js ikoresha porogaramu hamwe na pake ya npm :
npm install bootstrap
const bootstrap = require('bootstrap')
cyangwa import bootstrap from 'bootstrap'
izapakira amacomeka ya Bootstrap yose kubintu bootstrap
. Module bootstrap
ubwayo yohereza ibicuruzwa byacu byose. Urashobora kwikorera intoki amacomeka ya Bootstrap kugiti cyawe ukuramo /js/dist/*.js
dosiye munsi yububiko bwa top-level.
Bootstrap package.json
irimo metadata yinyongera munsi yimfunguzo zikurikira:
sass
- inzira kuri Bootstrap nyamukuru ya Sass isoko ya dosiyestyle
- inzira igana Bootstrap ya CSS idacukuwe CSS yabanjirijwe hakoreshejwe igenamiterere risanzwe (nta kwihindura)
yarn
Shyira Bootstrap muri Node.js ikoresha porogaramu hamwe nudupapuro twiza :
yarn add bootstrap
RubyGems
Shyira Bootstrap muri porogaramu zawe za Ruby ukoresheje Bundler ( bisabwa ) na RubyGems wongeyeho umurongo ukurikira kuri Gemfile
:
gem 'bootstrap', '~> 5.0.2'
Ubundi, niba udakoresha Bundler, urashobora gushiraho amabuye y'agaciro ukoresheje iri tegeko:
gem install bootstrap -v 5.0.2
Reba ibisobanuro by'amabuye y'agaciro kugirango ubone ibisobanuro birambuye.
Uwayihimbye
Urashobora kandi kwinjizamo no gucunga Sass ya Bootstrap na JavaScript ukoresheje Composer :
composer require twbs/bootstrap:5.0.2
NuGet
Niba utezimbere muri .NET, urashobora kandi kwinjizamo no gucunga CSS ya Bootstrap cyangwa Sass na JavaScript ukoresheje NuGet :
Install-Package bootstrap
Install-Package bootstrap.sass