Jya ku bintu nyamukuru Jya kuri docs
in English

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 .

Kugirango ukoreshe sisitemu yo kubaka no gukoresha inyandiko zacu mugace, uzakenera kopi ya dosiye ya Bootstrap yinkomoko na Node. Kurikiza izi ntambwe kandi ugomba kuba witeguye kunyeganyega:

  1. Kuramo hanyuma ushyire Node.js , dukoresha mugucunga ibyo twishingikirije.
  2. Hitamo gukuramo inkomoko ya Bootstrap cyangwa fork ububiko bwa Bootstrap .
  3. Kujya mumuzi /bootstrapyububiko hanyuma wiruke npm installkugirango ushyireho ibyo twishingikirije kurutonde rwa pack.json .

Numara kuzuza, uzashobora gukoresha amategeko atandukanye yatanzwe kuva kumurongo.

Gukoresha inyandiko za npm

Package yacu.json ikubiyemo imirimo myinshi yo guteza imbere umushinga. Iruka npm runkugirango urebe inyandiko zose za npm muri terminal yawe. Inshingano z'ibanze zirimo:

Inshingano Ibisobanuro
npm start Gukusanya CSS na JavaScript, yubaka inyandiko, kandi itangira seriveri yaho.
npm run dist Kurema dist/ububiko hamwe namadosiye yakozwe. Irasaba Sass , Autoprefixer , na terser .
npm test Gukora ibizamini byaho nyuma yo kwirukanpm run dist
npm run docs-serve Yubaka kandi ikoresha ibyangombwa byaho.
Tangira na Bootstrap ukoresheje npm hamwe numushinga utangira! Kujya kuri twbs / bootstrap-npm-itangira inyandikorugero yububiko kugirango urebe uko wubaka no gutunganya Bootstrap mumushinga wawe bwite wa npm. Harimo icyegeranyo cya Sass, Autoprefixer, Stylelint, PurgeCSS, na Bootstrap Udushushondanga.

Sass

Bootstrap ikoresha Dart Sass mugukusanya amadosiye yacu ya Sass muri dosiye ya CSS (yashyizwe mubikorwa byacu byo kubaka), kandi turagusaba ko wabikora niba urimo ukora Sass ukoresheje umuyoboro wawe bwite. Twabanje gukoresha Node Sass kuri Bootstrap v4, ariko LibSass hamwe nububiko bwubatswe hejuru yacyo, harimo na Node Sass, ubu birataye agaciro .

Dart Sass ikoresha uruziga rusobanutse rwa 10 kandi kubwimpamvu zikora neza ntabwo zemerera guhindura agaciro. Ntabwo dushyira ahagaragara ubu busobanuro mugihe cyo kurushaho gutunganya CSS twabyaye, nko mugihe cyo kugabanya, ariko niba wahisemo kubikora turasaba kugumana byibuze byibuze 6 kugirango twirinde ibibazo hamwe no kuzenguruka mushakisha.

Autoprefixer

Bootstrap ikoresha Autoprefixer (ikubiye mubikorwa byacu byo kubaka) kugirango ihite yongeramo ibicuruzwa byabacuruzi kubintu bimwe na bimwe bya CSS mugihe cyo kubaka. Kubikora bidutwara umwanya na code mukwemerera 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.

RTLCSS

Bootstrap ikoresha RTLCSS mugutunganya CSS yakozwe no kuyihindura kuri RTL - mubyukuri gusimbuza icyerekezo gitambitse kimenya imitungo (urugero. padding-left) Nibinyuranye. Iratwemerera kwandika CSS yacu inshuro imwe gusa no gukora udukoryo duto dukoresheje igenzura rya RTLCSS hamwe nubuyobozi bwagaciro .

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:

  1. Koresha ukoresheje ibikoresho byashizweho hejuru kugirango ushyireho ibintu byose.
  2. Kuva kumuzi /bootstrapyububiko, koresha npm run docs-servemumurongo wumurongo.
  3. 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.