Ngundhuh
Download Bootstrap kanggo entuk CSS lan JavaScript sing dikompilasi, kode sumber, utawa kalebu karo manajer paket favorit kaya npm, RubyGems, lan liya-liyane.
Kompilasi CSS lan JS
Download kode kompilasi sing siap digunakake kanggo Bootstrap v5.1.3 supaya gampang dilebokake ing proyek sampeyan, kalebu:
- Bundel CSS sing dikompilasi lan dikurangi (deleng perbandingan file CSS )
- Plugin JavaScript sing dikompilasi lan diminimalisir (ndeleng perbandingan file JS )
Iki ora kalebu dokumentasi, file sumber, utawa dependensi JavaScript opsional kaya Popper.
File sumber
Kompilasi Bootstrap nganggo pipa aset sampeyan kanthi ngundhuh file Sass, JavaScript, lan dokumentasi sumber kita. Opsi iki mbutuhake sawetara perkakas tambahan:
- Sass compiler kanggo kompilasi file sumber Sass menyang file CSS
- Autoprefixer kanggo CSS vendor prefixing
Yen sampeyan mbutuhake set lengkap alat mbangun , padha kalebu kanggo ngembangake Bootstrap lan dokumen, nanging padha ora cocog kanggo tujuan sampeyan dhewe.
Tuladha
Yen sampeyan pengin ndownload lan mriksa conto kita , sampeyan bisa njupuk conto sing wis dibangun:
CDN liwat jsDelivr
Skip download nganggo jsDelivr kanggo ngirim versi cache saka CSS lan JS kompilasi Bootstrap menyang proyek sampeyan.
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous">
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" integrity="sha384-ka7Sk0Gln4gmtz2MlQnikT1wXgYsOg+OMhuP+IlRH9sENBO0LRn5q+8nbTov4+1p" crossorigin="anonymous"></script>
Yen sampeyan nggunakake JavaScript sing dikompilasi lan luwih seneng nglebokake Popper kanthi kapisah, tambahake Popper sadurunge JS kita, luwih becik liwat CDN.
<script src="https://cdn.jsdelivr.net/npm/@popperjs/[email protected]/dist/umd/popper.min.js" integrity="sha384-7+zCNj/IqJ95wo16oMtfsKbZ9ccEh31eOz1HGyDuCQ6wgnyJNSYdrPa03rtR1zdB" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.min.js" integrity="sha384-QJHtvGhmr9XOIpI6YVutG+2QOK9T+ZnN4kzFN1RtK3zEFEIsxhlmWl5/YESvpZ13" crossorigin="anonymous"></script>
Manajer paket
Narik file sumber Bootstrap menyang meh kabeh proyek karo sawetara manajer paket sing paling populer. Ora preduli manajer paket, Bootstrap mbutuhake kompiler Sass lan Autoprefixer kanggo persiyapan sing cocog karo versi kompilasi resmi kita.
npm
Instal Bootstrap ing aplikasi bertenaga Node.js kanthi paket npm :
npm install bootstrap
const bootstrap = require('bootstrap')
utawa import bootstrap from 'bootstrap'
bakal mbukak kabeh plugin Bootstrap menyang bootstrap
obyek. Modul bootstrap
kasebut dhewe ngekspor kabeh plugin kita. Sampeyan bisa mbukak plugin Bootstrap kanthi manual kanthi ngemot /js/dist/*.js
file ing direktori tingkat paling dhuwur paket kasebut.
Bootstrap package.json
ngemot sawetara metadata tambahan ing ngisor iki:
sass
- path menyang file sumber Sass utama Bootstrapstyle
- path menyang CSS non-minified Bootstrap sing wis dikompilasi nggunakake setelan gawan (ora kustomisasi)
tenunan
Instal Bootstrap ing aplikasi Node.js sampeyan kanthi paket benang :
yarn add bootstrap
RubyGems
Instal Bootstrap ing aplikasi Ruby sampeyan nggunakake Bundler ( disaranake ) lan RubyGems kanthi nambahake baris ing ngisor iki menyang Gemfile
:
gem 'bootstrap', '~> 5.1.3'
Utawa, yen sampeyan ora nggunakake Bundler, sampeyan bisa nginstal permata kanthi nggunakake printah iki:
gem install bootstrap -v 5.1.3
Waca README permata kanggo rincian liyane.
Komposer
Sampeyan uga bisa nginstal lan ngatur Bootstrap's Sass lan JavaScript nggunakake Composer :
composer require twbs/bootstrap:5.1.3
NuGet
Yen sampeyan ngembangake ing .NET, sampeyan uga bisa nginstal lan ngatur CSS utawa Sass lan JavaScript Bootstrap nggunakake NuGet :
Install-Package bootstrap
Install-Package bootstrap.sass