Jya ku bintu nyamukuru Jya kuri docs
Check
in English

Tanga umusanzu

Fasha guteza imbere Bootstrap hamwe ninyandiko zacu zubaka inyandiko n'ibizamini.

Igikoresho

Bootstrap ikoresha inyandiko ya npm kugirango yubake inyandiko kandi ikusanya amadosiye yinkomoko. Package yacu.json ibika iyi nyandiko yo gukusanya code, gukora ibizamini, nibindi byinshi. Ibi ntabwo bigenewe gukoreshwa hanze yububiko bwacu hamwe ninyandiko.

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:

  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 Kora dist/ububiko hamwe namadosiye yakozwe. Koresha 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 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.

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 mugace bisaba gukoresha Hugo, igashyirwaho binyuze muri pake ya hugo-bin npm. Hugo nihuta cyane kandi yagutse cyane ya generator yurubuga iduha: ibyingenzi birimo, Markdown-ishingiye kuri dosiye, inyandikorugero, nibindi byinshi. Dore uko wabitangira:

  1. Koresha unyuze mubikoresho 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). Noneho, ongera usubire npm install.