Source

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 yakusanyirijwe kuri Bootstrap v4.1.3 kugirango igabanuke byoroshye mumushinga wawe, urimo:

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

Kuramo

Amadosiye

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

  • Gukusanya Sass (Libsass cyangwa Ruby Sass irashyigikiwe) mugukusanya CSS yawe.
  • Autoprefixer kubucuruzi bwa CSS ibanziriza

Ukeneye ibikoresho byubaka , birashyizwe mugutezimbere Bootstrap hamwe na docs, ariko birashoboka ko bidakwiriye intego zawe.

Gukuramo isoko

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-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous">
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.min.js" integrity="sha384-ChfqqxuZUCnJSK3+MXmPNIyE6ZbWh2IMqE241rYiqJxyMiZ6OW/JmZQ5stwEULTy" crossorigin="anonymous"></script>

Niba ukoresha JavaScript yacu yakozwe, ntuzibagirwe gushyiramo CDN verisiyo ya jQuery na Popper.js mbere yayo.

<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/umd/popper.min.js" integrity="sha384-ZMP7rVo3mIykV+2+9J3UJ46jBk0WLaUAdn689aCwoqbBJiSnjAK/l8WvCWPIPm49" crossorigin="anonymous"></script>

Abashinzwe gupakira

Kurura muri dosiye ya Bootstrap hafi yumushinga uwo ariwo wose hamwe nabayobozi benshi 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

require('bootstrap')izashyira amacomeka ya jQuery yose ya Bootstrap kubintu bya jQuery. Module bootstrapubwayo ntacyo yohereza hanze. Urashobora kwifashisha intoki za Bootstrap ya jQuery plugins kugiti cyawe ukuramo /js/*.jsdosiye munsi yububiko bwurwego rwo hejuru.

Bootstrap package.jsonirimo metadata yinyongera munsi yimfunguzo zikurikira:

  • sass- inzira kuri Bootstrap nyamukuru ya Sass isoko ya dosiye
  • style- inzira igana Bootstrap ya CSS idacukuwe CSS yabanjirijwe hakoreshejwe igenamiterere risanzwe (nta kwihindura)

RubyGems

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

gem 'bootstrap', '~> 4.1.3'

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

gem install bootstrap -v 4.1.3

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:4.1.3

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