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.1.3 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-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>

Ọ 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.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>

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 achịkọtara nke ejiri ntọala ndabara (enweghị nhazi)

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.1.3'

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.1.3

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.1.3

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