Source

Haha lisebelisoa

Ithute ho sebelisa lingoloa tsa Bootstrap tse kenyellelitsoeng tsa npm ho theha litokomane tsa rona, ho bokella khoutu ea mohloli, ho etsa liteko, le tse ling.

Ho hlophisoa ha lisebelisoa

Bootstrap e sebelisa lingoloa tsa npm bakeng sa sistimi ea eona ea kaho. Pakete ea rona.json e kenyelletsa mekhoa e bonolo ea ho sebetsa le moralo, ho kenyelletsa ho bokella khoutu, ho etsa liteko, le tse ling.

Ho sebelisa sistimi ea rona ea kaho le ho tsamaisa litokomane tsa rona sebakeng sa heno, o tla hloka khopi ea lifaele tsa mohloli oa Bootstrap le Node. Latela mehato ena 'me u lokela ho itokisetsa ho roka:

  1. Khoasolla le ho kenya Node.js , eo re e sebelisang ho laola lintho tseo re itšetlehileng ka tsona.
  2. Tsamaea ho buka ea motso /bootstrap'me u mathe npm installho kenya litšepiso tsa rona tsa lehae tse thathamisitsoeng ho package.json .
  3. Kenya Ruby , kenya Bundler ka gem install bundler, 'me qetellong u tsamaee bundle install. Sena se tla kenya litšepiso tsohle tsa Ruby, joalo ka Jekyll le li-plugins.
    • Basebelisi ba Windows: Bala tataiso ena ho etsa hore Jekyll a sebetse ntle le mathata.

Ha o qetile, o tla khona ho tsamaisa litaelo tse fapaneng tse fanoeng ho tsoa moleng oa taelo.

Ho sebelisa lingoloa tsa npm

Pakete ea rona.json e kenyelletsa litaelo le mesebetsi e latelang:

Mosebetsi Tlhaloso
npm run dist npm run diste theha /dist/directory e nang le lifaele tse hlophisitsoeng. E sebelisa Sass , Autoprefixer , le UglipJS .
npm test Hoa tšoana npm run distle hore e etsa liteko sebakeng sa heno
npm run docs E haha ​​​​le ho kopanya CSS le JavaScript bakeng sa litokomane. Joale u ka tsamaisa litokomane sebakeng sa heno ka npm run docs-serve.

Matha npm runho bona lingoloa tsohle tsa npm.

Autoprefixer

Bootstrap e sebelisa Autoprefixer (e kenyellelitsoeng ts'ebetsong ea rona ea ho aha) ho kenyelletsa li-prefixes tsa barekisi ho thepa e 'ngoe ea CSS ka nako ea kaho. Ho etsa joalo ho re bolokela nako le khoutu ka ho re lumella ho ngola likarolo tsa bohlokoa tsa CSS ea rona ka nako e le 'ngoe ha re ntse re tlosa tlhokahalo ea metsoako ea barekisi e kang e fumanoang ho v3.

Re boloka lethathamo la libatli tse tšehetsoeng ke Autoprefixer faeleng e arohaneng ka har'a polokelo ea rona ea GitHub. Sheba .browserslistrc bakeng sa lintlha tse ling.

Litokomane tsa lehae

Ho tsamaisa litokomane tsa rona sebakeng sa heno ho hloka ts'ebeliso ea Jekyll, jenereithara ea sebaka sa marang-rang se feto-fetohang se re fang: tsa mantlha li kenyelletsa, lifaele tse thehiloeng ho Markdown, litempele, le tse ling. Tsela ea ho e qala ke ena:

  1. Matha ka setupong sa lisebelisoa ka holimo ho kenya Jekyll (sehahi sa sebaka sa marang-rang) le tse ling tse itšetlehileng ka Ruby ka bundle install.
  2. Ho tsoa bukeng ea motso /bootstrap, matha npm run docs-servemoleng oa taelo.
  3. Bula http://localhost:9001ho sebatli sa hau, 'me u voilà.

Ithute haholoanyane ka ho sebelisa Jekyll ka ho bala litokomane tsa eona .

Ho batle phoso

Haeba u ka kopana le mathata ka ho kenya li- dependencies, tlosa mefuta eohle e fetileng ea ho itšetleha (ea lefats'e le ea lehae). Ebe u khutlisetsa npm install.