Kubaka ibikoresho
Wige gukoresha Bootstrap irimo npm inyandiko za npm kugirango twubake inyandiko, gukusanya code yinkomoko, gukora ibizamini, nibindi byinshi.
Igikoresho
Bootstrap ikoresha npm inyandiko za sisitemu yo kubaka. Porogaramu yacu.json ikubiyemo uburyo bworoshye bwo gukorana nurwego, harimo gukusanya code, gukora ibizamini, nibindi byinshi .
Kugira ngo ukoreshe sisitemu yo kubaka no gukoresha inyandiko zacu mugace, uzakenera kopi yama dosiye ya Bootstrap na Node. Kurikiza izi ntambwe kandi ugomba kuba witeguye kunyeganyega:
- Kuramo hanyuma ushyire Node.js , dukoresha mugucunga ibyo twishingikirije.
- Hitamo gukuramo inkomoko ya Bootstrap cyangwa fork ububiko bwa Bootstrap .
- Kujya mumuzi
/bootstrap
yububiko hanyuma wirukenpm install
kugirango ushyireho ibyo twishingikirije kurutonde rwa pack.json .
Numara kuzuza, uzashobora gukoresha amategeko atandukanye yatanzwe kuva kumurongo.
Gukoresha inyandiko za npm
Package yacu.json ikubiyemo amategeko nimirimo ikurikira:
Inshingano | Ibisobanuro |
---|---|
npm run dist |
npm run dist Kurema /dist/ Ububiko hamwe na dosiye. Koresha Sass , Autoprefixer , na terser . |
npm test |
Gukora ibizamini byaho nyuma yo kwirukanpm run dist |
npm run docs-serve |
Yubaka kandi ikoresha ibyangombwa byaho. |
Kwiruka npm run
kugirango urebe inyandiko zose za npm.
Sass
Bootstrap v4 ikoresha Node Sass mugukusanya amadosiye yacu ya Sass muri dosiye ya CSS (bikubiye mubikorwa byacu byo kubaka). Kugirango urangire hamwe na CSS yakozwe mugihe cyo gukusanya Sass ukoresheje umuyoboro wawe bwite, uzakenera gukoresha Sass compiler ishyigikira byibuze ibintu Node Sass ikora. Ibi ni ngombwa kumenya kuko guhera ku ya 26 Ukwakira 2020, LibSass hamwe nudupaki twubatswe hejuru yacyo - harimo na Node Sass - birasuzuguritse .
Niba ukeneye ibintu bishya bya Sass cyangwa guhuza nibipimo bishya bya CSS, Dart Sass ubu niyo ishyirwa mubikorwa ryambere rya Sass kandi ishyigikira JavaScript API ihuza rwose na Node Sass (hamwe na bake usibye kurutonde rwa GitHub ya Dart Sass ).
Twongereye Sass kuzenguruka neza kuri 6 (mubisanzwe, ni 5 muri Node Sass) kugirango twirinde ibibazo hamwe no kuzenguruka kwa mushakisha. Niba ukoresheje Dart Sass ntabwo bizaba arikintu ukeneye guhindura, kuko uwakusanyije akoresha uruziga rwa 10 kandi kubwimpamvu zikora neza ntirwemerera guhinduka.
Autoprefixer
Bootstrap ikoresha Autoprefixer (ikubiye mubikorwa byacu byo kubaka) kugirango ihite yongeramo ibicuruzwa byabacuruzi kubintu bimwe na bimwe bya CSS mugihe cyo kubaka. Kubikora bidukiza umwanya na code bitwemerera kwandika ibice byingenzi bya CSS yacu icyarimwe mugihe cyo gukuraho ibikenerwa bivangwa nabacuruzi nkibiboneka muri v3.
Turakomeza urutonde rwa mushakisha ushyigikiwe na Autoprefixer muri dosiye itandukanye mububiko bwacu bwa GitHub. Reba .browserslistrc kubisobanuro birambuye.
Inyandiko zaho
Gukoresha inyandiko zacu bisaba gukoresha Hugo, igashyirwaho binyuze muri pake ya hugo-bin npm. Hugo nihuta cyane kandi yagutse cyane ya generator yurubuga iduha: ibyibanze birimo, Markdown ishingiye kuri dosiye, inyandikorugero, nibindi byinshi. Dore uko wabitangira:
- Koresha ukoresheje ibikoresho byashizweho hejuru kugirango ushyireho ibintu byose.
- Kuva kumuzi
/bootstrap
yububiko, koreshanpm run docs-serve
mumurongo wumurongo. - Fungura
http://localhost:9001/
muri mushakisha yawe, na voilà.
Wige byinshi kubyerekeye gukoresha Hugo usoma inyandiko zayo .
Gukemura ibibazo
Ugomba guhura nibibazo byo kwishyiriraho, kuramo verisiyo zose zabanjirije kwishingikiriza (kwisi yose hamwe n’ibanze). Noneho, ongera usubire npm install
.