Source

Kubaka ibikoresho

Wige gukoresha Bootstrap irimo npm inyandiko za npm kugirango twubake inyandiko, gukusanya code yinkomoko, gukora ibizamini, nibindi byinshi.

Igikoresho

Bootstrap ikoresha inyandiko za NPM kuri 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. Kujya mumuzi /bootstrapyububiko hanyuma wiruke npm installkugirango ushyireho ibyo twishingikirije kurutonde rwa pack.json .
  3. Shyiramo Ruby , shyiramo Bundler hamwe gem install bundler, hanyuma ukore bundle install. Ibi bizashyiraho Ruby byose biterwa, nka Jekyll na plugins.
    • Abakoresha Windows: Soma iki gitabo kugirango Jekyll azamuke kandi akore nta kibazo.

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 /distUbubiko hamwe na dosiye. Koresha Sass , Autoprefixer , na UglifyJS .
npm test Kimwe na npm run distplus ikora ibizamini byaho
npm run docs Kubaka no gutondeka CSS na JavaScript ya doc. Urashobora noneho gukoresha inyandiko mugace ukoresheje npm run docs-serve.

Iruka npm runkugirango urebe inyandiko zose za npm.

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 /package.json kubisobanuro birambuye.

Inyandiko zaho

Gukoresha inyandiko zacu mugace bisaba gukoresha Jekyll, generator yurubuga rwimiterere ihindagurika iduha: ibyingenzi birimo, Markdown ishingiye kumadosiye, inyandikorugero, nibindi byinshi. Dore uko wabitangira:

  1. Koresha unyuze mubikoresho byashizweho hejuru kugirango ushyire Jekyll (uwubaka urubuga) nibindi biterwa na Ruby hamwe bundle install.
  2. Kuva kumuzi /bootstrapyububiko, koresha npm run docs-servemumurongo wumurongo.
  3. Fungura http://localhost:9001muri mushakisha yawe, na voilà.

Wige byinshi kubyerekeye gukoresha Jekyll 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.