in English

Kuramo

Kuramo Bootstrap kugirango ubone CSS hamwe na JavaScript yakozwe, 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 v4.6.2 kugirango igabanuke byoroshye mumushinga wawe, urimo:

Ibi ntabwo birimo inyandiko, amadosiye yinkomoko, cyangwa JavaScript itabishaka (jQuery na Popper).

Kuramo

Amadosiye

Gukusanya Bootstrap hamwe numuyoboro wawe bwite ukuramo isoko Sass, JavaScript, hamwe namadosiye yinyandiko. Ihitamo risaba ibikoresho byinyongera:

Ugomba gukenera ibikoresho byuzuye byubaka , zirimo guteza imbere Bootstrap hamwe na doc zayo, ariko birashoboka ko bidakwiriye intego zawe.

Gukuramo isoko

Ingero

Niba ushaka gukuramo no gusuzuma ingero zacu , urashobora gufata ingero zimaze kubakwa:

Kuramo Ingero

jsDelivr

Kureka gukuramo hamwe na jsDelivr kugirango utange verisiyo ya cashe ya Bootstrap yakozwe CSS na JS kumushinga wawe.

<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" integrity="sha384-xOolHFLEh07PJGoPkLv1IbcEPTNtaed2xpHsD9ESMhqIYd0nLMwNLD69Npy4HI+N" crossorigin="anonymous">
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" integrity="sha384-Fy6S3B9q64WdZWQUiU+q4/2Lc9npb8tCaSX9FK7E8HnRr0Jz8D6OP9dO5Vg3Q9ct" 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/[email protected]/dist/jquery.slim.min.js" integrity="sha384-DfXdz2htPH0lsSSs5nCTpuj/zy4C+OGpamoFVy38MVBnE+IbbVYUew+OrCXaRkfj" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/umd/popper.min.js" integrity="sha384-9/reFTGAW83EW2RDu2S0VKaIzap3H66lZH81PoYlFhbGU+6BZp6G7niu735Sk7lN" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.min.js" integrity="sha384-+sLIOodYLS7CIrQpBjl+C7nPvqq+FbNUBDunl/OZv93DB7Ln/533i8e/mZXLi/P+" 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 dushyire hamwe duhuza verisiyo yemewe.

npm

Shyira Bootstrap muri Node.js ikoresha porogaramu hamwe na pake ya npm :

npm install bootstrap

require('bootstrap')izashyira amacomeka ya jQuery yose ya Bootstrap kubintu bya jQuery. Module bootstrapubwayo ntacyo yohereza hanze. Urashobora kwipakurura intoki za jQuery ya Bootstrap kugiti cyawe ukuramo /js/*.jsdosiye munsi yububiko bwa top-level.

Bootstrap package.jsonirimo metadata yinyongera munsi yimfunguzo zikurikira:

  • sass- inzira kuri Bootstrap nyamukuru ya Sass isoko ya dosiye
  • style- inzira igana Bootstrap ya CSS itagabanijwe CSS yabanjirijwe hakoreshejwe igenamiterere risanzwe (nta kwihindura)
Tangira na Bootstrap ukoresheje npm hamwe numushinga utangira! Kujya kuri twbs / bootstrap-npm-itangira inyandikorugero yububiko kugirango urebe uko wubaka no gutunganya Bootstrap mumushinga wawe bwite wa npm. Harimo icyegeranyo cya Sass, Autoprefixer, Stylelint, PurgeCSS, na Bootstrap Udushushondanga.

yarn

Shyira Bootstrap muri Node.js ikoresha porogaramu hamwe nudupapuro twiza :

yarn add bootstrap

RubyGems

Shyira Bootstrap muri porogaramu zawe za Ruby ukoresheje Bundler ( usabwe ) na RubyGems wongeyeho umurongo ukurikira kuri Gemfile:

gem 'bootstrap', '~> 4.6.2'

Ubundi, niba udakoresha Bundler, urashobora gushiraho amabuye y'agaciro ukoresheje iri tegeko:

gem install bootstrap -v 4.6.2

Reba ibisobanuro by'amabuye y'agaciro kugirango ubone ibisobanuro birambuye.

Uwayihimbye

Urashobora kandi gushiraho no gucunga Sass na JavaScript ya Bootstrap ukoresheje Composer :

composer require twbs/bootstrap:4.6.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