Source

Budata

Budata Bootstrap iji nweta CSS na Javascript achịkọtara, koodu isi mmalite, ma ọ bụ tinye ya na ndị njikwa ngwugwu ọkacha mmasị gị dị ka npm, RubyGems na ndị ọzọ.

Achịkọtara CSS na JS

Budata koodu achịkọtara ejikere maka Bootstrap v4.4.1 ka itinye ngwa ngwa n'ime ọrụ gị, nke gụnyere:

  • Ngwungwu CSS achịkọtara na nke pere mpe (lee ntụnyere faịlụ CSS )
  • Ngwa mgbakwunye Javascript achịkọtara na nke pere mpe

Nke a anaghị agụnye akwụkwọ, faịlụ isi mmalite, ma ọ bụ ndabere Javascript nhọrọ ọ bụla (jQuery na Popper.js).

Budata

Isi mmalite faịlụ

Jiri pipeline akpaaka gị chịkọta Bootstrap site na nbudata isi iyi Sass, Javascript na faịlụ akwụkwọ. Nhọrọ a chọrọ ụfọdụ ngwa mgbakwunye:

  • Sass compiler (Libsass ma ọ bụ Ruby Sass na-akwado) maka ịchịkọta CSS gị.
  • Autoprefixer maka prefixer onye na-ere CSS

Ọ bụrụ na ịchọrọ ihe eji arụ ọrụ , etinyere ha maka ịmepụta Bootstrap na docs ya, mana ha agaghị adabara ebumnuche nke gị.

Budata isi iyi

jsDelivr

Jiri jsDelivr mafee nbudata ahụ iji wepụta ụdị cache nke Bootstrap chịkọtara CSS na JS n'ọrụ gị.

<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous">
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.min.js" integrity="sha384-wfSDF2E50Y2D1uUdj0O3uMBJnjuUD4Ih7YwaYd1iqfktj0Uod8GCExl3Og8ifwB6" crossorigin="anonymous"></script>

Ọ bụrụ na ị na-eji Javascript anyị achịkọtara, echefula itinye ụdị CDN nke jQuery na Popper.js n'ihu ya.

<script src="https://code.jquery.com/jquery-3.4.1.slim.min.js" integrity="sha384-J6qa4849blE2+poT4WnyKhv5vZF5SrPo0iEjwBvKU7imGFAV0wwj1yYfoRSJoZ+n" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/umd/popper.min.js" integrity="sha384-Q6E9RHvbIyZFJoft+2mJbHaEWldlvI9IOYy5n3zV9zzTtmI3UksdQRVvoxMfooAo" crossorigin="anonymous"></script>

Ndị njikwa ngwugwu

Weghachite faịlụ isi mmalite Bootstrap n'ime ihe fọrọ nke nta ka ọ bụrụ ọrụ ọ bụla nwere ụfọdụ njikwa ngwugwu kachasị ewu ewu. N'agbanyeghị onye njikwa ngwugwu, Bootstrap ga- achọ Sass compiler na Autoprefixer maka nhazi nke dabara na ụdị anyị achịkọtara.

npm

Wụnye Bootstrap na ngwa Node.js gị nwere ngwugwu npm :

npm install bootstrap

require('bootstrap')ga-ebunye ihe mgbakwunye jQuery Bootstrap na ihe jQuery. Modul bootstrapn'onwe ya anaghị ebupụ ihe ọ bụla. Ị nwere ike iji aka buo Bootstrap's jQuery plugins n'otu n'otu site na ịkwanye /js/*.jsfaịlụ ndị dị n'okpuru akwụkwọ ndekọ aha dị elu nke ngwugwu.

Bootstrap package.jsonnwere ụfọdụ metadata agbakwunyere n'okpuru igodo ndị a:

  • sass- ụzọ isi Bootstrap isi faịlụ Sass
  • style- ụzọ na-aga Bootstrap CSS na-abụghị nke a chịkọtara nke ọma site na iji ntọala ndabara (enweghị nhazi)

yarn

Wụnye Bootstrap na ngwa Node.js gị na ngwugwu yarn :

yarn add bootstrap

RubyGems

Wụnye Bootstrap na ngwa Ruby gị site na iji Bundler ( akwadoro ) na RubyGems site na ịgbakwunye ahịrị ndị a na gị Gemfile:

gem 'bootstrap', '~> 4.4.1'

N'aka nke ọzọ, ọ bụrụ na ị naghị eji Bundler, ị nwere ike ịwụnye gem site na iji iwu a:

gem install bootstrap -v 4.4.1

Hụ ọnụ ahịa README maka nkọwa ndị ọzọ.

Onye na-ede ihe

Ị nwekwara ike iwunye ma jikwaa Bootstrap's Sass na JavaScript site na iji Onye na-ede ihe :

composer require twbs/bootstrap:4.4.1

NuGet

Ọ bụrụ na ịmalite na NET, ị nwekwara ike ịwụnye ma jikwaa Bootstrap's CSS ma ọ bụ Sass na JavaScript site na iji NuGet :

Install-Package bootstrap
Install-Package bootstrap.sass