Akpa webụ
Mụta otu esi etinye Bootstrap n'ọrụ gị site na iji Webpack.
Ịwụnye Bootstrap
Wụnye bootstrap dị ka modul Node.js site na iji npm.
Na-ebubata JavaScript
Bubata JavaScript nke Bootstrap site na ịgbakwunye ahịrị a na ntinye ngwa gị (na-emekarị index.js
ma ọ bụ app.js
):
N'aka nke ọzọ, ịnwere ike ibubata plugins n'otu n'otu dịka achọrọ:
Bootstrap dabere na jQuery na Popper , nke akọwapụtara na ihe peerDependencies
onwunwe; nke a pụtara na ị ga-enwerịrị ike ịgbakwunye ha abụọ na iji package.json
gị npm install --save jquery popper.js
.
Ụdị mbubata
Na-ebubata Sass agbakọtagoro
Iji kporie ndụ zuru oke nke Bootstrap ma hazie ya ka ọ bụrụ mkpa gị, jiri faịlụ isi mmalite dịka akụkụ nke usoro nchịkọta ọrụ gị.
Nke mbụ, mepụta nke gị _custom.scss
wee jiri ya kagbuo ụdị mgbanwe omenala arụnyere n'ime ya . Mgbe ahụ, jiri isi faịlụ Sass gị bubata mgbanwe omenala gị, Bootstrap sochiri ya:
Maka Bootstrap iji chịkọta, jide n'aka na ị wụnye ma jiri ihe ndị a chọrọ: sass-loader , postcss-loader with Autoprefixer . Site na nhazi ntakịrị, nhazi akpa weebụ gị kwesịrị ịgụnye iwu a ma ọ bụ ihe yiri ya:
Na-ebubata CSS chịkọtara
N'aka nke ọzọ, ịnwere ike iji CSS dị njikere iji Bootstrap site na ịgbakwunye ahịrị a na ntinye ọrụ gị:
N'okwu a, ịnwere ike iji iwu gị dị ugbu a na- css
enweghị mgbanwe ọ bụla na nhazi webpack, belụsọ na ịchọghị sass-loader
naanị ụdị-loader na css-loader .