Baarakɛminɛnw jɔ
Bootstrap ka npm sɛbɛnni minnu bɛ a kɔnɔ, olu baaracogo dɔn walasa ka an ka sɛbɛnw jɔ, ka source code lajɛ, ka sɛgɛsɛgɛliw kɛ, ani fɛn wɛrɛw.
Baarakɛminɛnw sigicogo
Bootstrap bɛ baara Kɛ ni npm sɛbɛnniw ye a ka jɔli-sistɛm kama. An ka package.json kɔnɔ, fɛɛrɛ nɔgɔmanw bɛ yen minnu bɛ se ka kɛ ka baara kɛ ni framework ye, i n’a fɔ kode dalajɛli, sɛgɛsɛgɛliw bolicogo, ani fɛn wɛrɛw.
Walasa ka baara kɛ ni an ka build system ye ani k’an ka sɛbɛnw baara sigida la, i mago bɛ Bootstrap ka source files ni Node kopi dɔ la. Aw bɛ nin fɛɛrɛ ninnu labato ani aw ka kan ka labɛn ka girin:
- Node.js , an bɛ baara Kɛ ni min ye walasa k’an ka dannayakow ɲɛnabɔ, o telesarse k’a Blà a la.
- Bootstrap ka sɔrɔyɔrɔw telesarse walima ka Bootstrap ka marayɔrɔ foroko .
- aw bɛ taa root
/bootstrap
directory la ka bolinpm install
walasa k' an ka sigida dantigɛliw sigi sen kan minnu kofɔlen bɛ package.json kɔnɔ .
Ni a dafara, i bɛ se ka cikan suguya minnu di ka bɔ cikan yɔrɔ la, i bɛ se ka olu baara.
Baara kɛ ni npm sɛbɛnniw ye
An ka package.json kɔnɔ, baara caman bɛ yen porozɛ in yiriwali kama. Boli npm run
ka npm sɛbɛnniw bɛɛ ye i ka terminal kɔnɔ. Baara fɔlɔw ye ninnu ye:
Baara | Cogojirali |
---|---|
npm start |
A bɛ CSS ni JavaScript lajɛ, ka sɛbɛnw jɔ, ka sigida baarakɛla dɔ daminɛ. |
npm run dist |
A bɛ dist/ ɲɛbilasɛbɛn Dabɔ ni dosiyew lajɛlenw ye. A bɛ Sass , Autoprefixer ani terser de wajibiya . |
npm test |
A bɛ boli sɛgɛsɛgɛliw kɛ sigida la boli kɔfɛnpm run dist |
npm run docs-serve |
A bɛ sɛbɛnw jɔ ani k’u baara sigida la. |
Sass ye
Bootstrap bɛ baara Kɛ ni Dart Sass ye walasa k’an ka Sass source filew Lajɛ ka Kɛ CSS filew ye (min bɛ an ka jɔli taabolo la), wa an b’a Fɔ i ye ko i k’o ɲɔgɔn Kɛ n’i bɛ Sass Lajɛ ni i yɛrɛ ka nafolo pipeline ye. An tun bɛ baara Kɛ ni Node Sass ye ka Tɛmɛ Bootstrap v4 kama, nka LibSass ni pake minnu jɔlen dòn a san fɛ, Node Sass fana sen bɛ o la, olu ma baara Kɛ sisan .
Dart Sass bɛ baara Kɛ ni 10 ye min bɛ Lamini tigitigi ani baarakɛcogo ɲuman kunw na a tɛ Sɔn o nafa in ladilanni ma. An tɛ nin tiɲɛni in Dɔgɔya an ka CSS labɛnnenw baaracogo wɛrɛw senfɛ, i n’a fɔ fɛn fitininw kɛtuma na, nka n’i y’a sugandi k’o kɛ an b’a ɲini i fɛ i ka tiɲɛni kɛcogo 6 mara a dɔgɔyalenba la walasa ka gɛlɛyaw bali ni navigatɔrɔw laminiko ye.
Yɛrɛ-prefixer (Yɔrɔ-fɔcogo)
Bootstrap bɛ baara Kɛ ni Autoprefixer ye (min bɛ an ka jɔli taabolo la) walasa ka feerekɛlaw ka ɲɛfɔlisenw Fàra a yɛrɛma CSS nafolo dɔw kan jɔli waati la. O kɛli bɛ waati ni kode kisi an ma ni a b’a to an bɛ se k’an ka CSS yɔrɔ kolomaw sɛbɛn siɲɛ kelen k’a sɔrɔ an bɛ feerekɛlaw ka mixinw mago bɔ i n’a fɔ minnu bɛ sɔrɔ v3 kɔnɔ.
An bɛ navigatɔrɔw lisɛli mara minnu bɛ dɛmɛ sɔrɔ Autoprefixer fɛ dosiye wɛrɛ kɔnɔ an ka GitHub marayɔrɔ kɔnɔ. Aw ye .browserslistrc lajɛ walasa ka kunnafoni wɛrɛw sɔrɔ.
RTLCSS ye
Bootstrap bɛ baara Kɛ ni RTLCSS ye walasa ka CSS lajɛlenw baara k’u Labɛn ka Kɛ RTL ye – a basigilen bɛ horizontal direction aware properties (misali la padding-left
) nɔ na n’u kɔkanna ye. A b’a To an bɛ an ka CSS sɛbɛn siɲɛ kelen dɔrɔn ani ka fɛn misɛnninw Kɛ ni RTLCSS control ani value directives ye.
Sigida sɛbɛnw
An ka sɛbɛnw bolicogo sigida la, o bɛ Hugo baara de wajibiya, o min bɛ Sìgiyɔrɔma hugo-bin npm pake fɛ. Hugo ye blazingly fast and quite extensible static site generator ye min bɛ an Di: basigiw bɛ yen, Markdown-based files, templates, ani fɛn wɛrɛw. A daminɛcogo filɛ nin ye:
- Boli ka tɛmɛ baarakɛminɛnw sigicogo kan sanfɛ walasa ka dependencies bɛɛ sigi sen kan.
- Ka bɔ root
/bootstrap
directory la, i ka bolinpm run docs-serve
cikan yɔrɔ la. - Da wuli
http://localhost:9001/
i ka navigatɛri kɔnɔ, ani voilà.
Aw ye kunnafoni wɛrɛw sɔrɔ Hugo baaracogo kan n' a ka sɛbɛnw kalanni ye .
Gɛlɛyaw ɲɛnabɔli
Ni i ye gɛlɛya sɔrɔ dependencies (daɲɛw sigili) la, i ka dependency version kɔrɔw bɛɛ bɔ (dugukolo kan ani sigida la). O kɔfɛ, i ka segin ka npm install
baara kɛ .