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ɔ, nin cikanw ni baara ninnu bɛ yen:
Baara | Cogojirali |
---|---|
npm run dist |
npm run dist bɛ /dist/ ɲɛbilasɛbɛn Dabɔ ni dosiyew lajɛlenw ye. A bɛ baara kɛ ni Sass , Autoprefixer ani terser ye . |
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. |
Boli npm run
ka npm sɛbɛnniw bɛɛ ye.
Sass ye
Bootstrap v4 bɛ baara Kɛ ni Node Sass ye walasa k’an ka Sass source filew Lajɛ ka Kɛ CSS filew ye (o bɛ an ka jɔli taabolo la). Walasa ka laban ni CSS kelen in ye min bɛ Labɛn n’i bɛ Sass dalajɛ ni i yɛrɛ ka nafolomafɛnw pipeline ye, i ka kan ka baara Kɛ ni Sass compiler ye min bɛ Node Sass bɛ baara minnu Kɛ, olu Dɛmɛ a dɔgɔyalenba la. O nafa ka bon k’a kɔlɔsi bawo k’a ta ɔkutɔburukalo tile 26 san 2020, LibSass ni pake minnu jɔlen bɛ a sanfɛ—Node Sass fana sen bɛ o la—olu tɛ baara la .
N’i mago bɛ Sass ka fɛn kuraw la walima ka bɛn ni CSS sariya kuraw ye, Dart Sass ye Sass waleyali fɔlɔ ye sisan ani a bɛ JavaScript API dɛmɛ min bɛ baara kɛ ni Node Sass ye kosɛbɛ (ni danfara damadɔw bɛ Dart Sass ka GitHub ɲɛ kan ).
An bɛ dɔ fara Sass rounding precision kan ka se 6 ma (a daminɛ na, a bɛ 5 la Node Sass kɔnɔ) walasa ka gɛlɛyaw bali navigatɔrɔ rounding la. N'i ye Dart Sass Kɛ nin tɛna Kɛ fɛn ye i ka kan ka min Labɛn, bari o daɲɛgafe in bɛ baara Kɛ ni rounding precision ye min ye 10 ye wa baarakɛcogo ɲuman kosɔn a t'a To a ka Labɛn.
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ɔ.
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ɔ a la (dugukolo kan ani sigida). O kɔfɛ, i ka segin ka npm install
baara kɛ .