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 .

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 amategeko nimirimo ikurikira:

Inshingano Ibisobanuro
npm run dist npm run distKurema /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 runkugirango urebe inyandiko zose za npm.

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 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:

  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.