Mafere na isi ọdịnaya Gaa na ntugharị docs
in English

Wulite ngwaọrụ

Mụta ka esi eji Bootstrap's gụnyere npm scripts iji wuo akwụkwọ anyị, chịkọta koodu isi mmalite, mee nnwale na ndị ọzọ.

Ntọlite ​​ngwa ọrụ

Bootstrap na-eji npm scripts maka usoro iwu ya. Package anyị.json gụnyere ụzọ dabara adaba maka ịrụ ọrụ n'usoro, gụnyere koodu nchịkọta, ule ịgba ọsọ, na ndị ọzọ.

Iji jiri sistemụ nrụpụta anyị wee mee akwụkwọ anyị na mpaghara, ị ga-achọ otu faịlụ isi mmalite Bootstrap na Node. Soro usoro ndị a ma ị ga-adị njikere ịme mkpọtụ:

  1. Budata ma wụnye Node.js , nke anyị na-eji jikwaa ndabere anyị.
  2. Budata isi mmalite Bootstrap ma ọ bụ ebe nchekwa Bootstrap ndụdụ .
  3. Gaa na ndekọ mgbọrọgwụ /bootstrapwee gbaa ọsọ npm installiji wụnye ndabere mpaghara anyị edepụtara na ngwugwu.json .

Mgbe emechara, ị ga-enwe ike ịme iwu dị iche iche enyere site na ahịrị iwu.

Iji npm script

Package anyị.json gụnyere ọtụtụ ọrụ maka ịmepụta ọrụ ahụ. Gbaa ọsọ npm runka ịhụ npm script niile dị na ọdụ gị. Ọrụ ndị mbụ gụnyere:

Ọrụ Nkọwa
npm start Na-achịkọta CSS na JavaScript, wulite akwụkwọ ahụ, wee malite sava mpaghara.
npm run dist Jiri dist/faịlụ achịkọtara mepụta ndekọ aha. Na- achọ Sass , Autoprefixer , na terser .
npm test Na-agba ule na mpaghara ka ọ gbachara ọsọnpm run dist
npm run docs-serve Na-ewu ma na-agba akwụkwọ na mpaghara.
Bido na Bootstrap site na npm site na iji ọrụ mmalite anyị! Gaba na twbs/bootstrap-npm-starter template repository ịhụ ka esi ewu na hazie Bootstrap n'ime ọrụ npm nke gị. Gụnyere Sass compiler, Autoprefixer, Stylelint, PurgeCSS, na Bootstrap Icons.

Sass

Bootstrap na-eji Dart Sass maka ịchịkọta faịlụ isi iyi Sass n'ime faịlụ CSS (gụnyere na usoro nrụpụta anyị), anyị na-akwado ka ị mee otu ihe ahụ ma ọ bụrụ na ị na-eji pipeline akụrụngwa gị na-achịkọta Sass. Anyị na-ejibu Node Sass maka Bootstrap v4, mana LibSass na ngwugwu ndị e wuru n'elu ya, gụnyere Node Sass, emebiela .

Dart Sass na-eji nhazi nkenke nke 10 na maka ịrụ ọrụ nke ọma anaghị ekwe ka mgbanwe nke uru a. Anyị anaghị ebelata nkenke a n'oge nhazi ọzọ nke CSS anyị emepụtara, dị ka n'oge mbelata, mana ọ bụrụ na ị họrọ ime ya, anyị na-akwado idobe nkenke nke opekata mpe 6 iji gbochie nsogbu na imechi ihe nchọgharị.

Akpa prefixer

Bootstrap na-eji Autoprefixer (gụnyere na usoro nrụpụta anyị) iji tinye prefixes ndị na-ere ahịa na ụfọdụ akụrụngwa CSS n'oge nrụpụta. Ime nke a na-azọpụta anyị oge na koodu site n'ikwe ka anyị dee akụkụ ndị bụ isi nke CSS anyị otu oge ka anyị na-ewepụ mkpa mixins ndị na-ere ahịa dị ka ndị ahụ na v3.

Anyị na-edobe ndepụta ihe nchọgharị akwadoro site na Autoprefixer na faịlụ dị iche n'ime ebe nchekwa GitHub anyị. Hụ .browserslistrc maka nkọwa.

RTLCSS

Bootstrap na-eji RTLCSS hazie CSS achịkọtara wee tụgharịa ha na RTL - na-edochi ihe njiri mara ntụzịaka kwụ ọtọ (dịka ọmụmaatụ padding-left). Ọ na-enye anyị ohere ide naanị CSS anyị otu oge wee mee obere tweaks site na iji njikwa RTLCSS na ntuziaka bara uru .

Akwụkwọ mpaghara

Ịme akwụkwọ anyị na mpaghara chọrọ iji Hugo, nke etinyere site na ngwugwu hugo-bin npm. Hugo bụ onye na-emepụta saịtị kwụ ọtọ nke ukwuu nke na-enye anyị: isi gụnyere, faịlụ ndị dabere na Markdown, ndebiri na ndị ọzọ. Nke a bụ otu esi amalite ya:

  1. Gaa na ntọala ngwaọrụ dị n'elu ka ịwụnye ndabere niile.
  2. Site na ndekọ mgbọrọgwụ /bootstrap, na-agba ọsọ npm run docs-servena ahịrị iwu.
  3. Mepee http://localhost:9001/na ihe nchọgharị gị, wee voilà.

Mụtakwuo maka iji Hugo site n'ịgụ akwụkwọ ya .

Nchọpụta nsogbu

Ọ bụrụ na ị ga-enwe nsogbu na ịwụnye ndabere, wepụ ụdị ndabere niile gara aga (ụwa na mpaghara). Mgbe ahụ, megharịa npm install.