Mangani zida
Phunzirani momwe mungagwiritsire ntchito zolemba za Bootstrap zomwe zikuphatikizidwa ndi npm kuti mupange zolemba zathu, kuphatikiza ma code source, kuyesa mayeso, ndi zina zambiri.
Bootstrap imagwiritsa ntchito zolemba za NPM pamakina ake omanga. Phukusi lathu.json limaphatikizapo njira zosavuta zogwirira ntchito ndi chimango, kuphatikiza kulemba ma code, kuyesa mayeso, ndi zina zambiri.
Kuti mugwiritse ntchito makina athu omanga ndikuyendetsa zolembedwa kwanuko, mufunika kopi ya mafayilo a Bootstrap ndi Node. Tsatirani izi ndipo muyenera kukhala okonzeka kugwedeza:
- Tsitsani ndikuyika Node.js , yomwe timagwiritsa ntchito kuyang'anira zomwe timadalira.
- Yendetsani ku chikwatu cha mizu
/bootstrap
ndikuthamangiranpm install
kuti muyike zodalira zathu zomwe zalembedwa pa package.json . - Ikani Ruby , yikani Bundler ndi
gem install bundler
, ndipo pamapeto pake thamanganibundle install
. Izi zidzakhazikitsa kudalira kwa Ruby, monga Jekyll ndi mapulagini.- Ogwiritsa ntchito Windows: Werengani bukuli kuti Jekyll ayambe kugwira ntchito popanda mavuto.
Mukamaliza, mudzatha kuyendetsa malamulo osiyanasiyana operekedwa kuchokera pamzere wolamula.
Pack.json yathu ili ndi malamulo ndi ntchito zotsatirazi:
Ntchito | Kufotokozera |
---|---|
npm run dist |
npm run dist imapanga /dist chikwatu ndi mafayilo ophatikizidwa. Amagwiritsa ntchito Sass , Autoprefixer , ndi UgifyJS . |
npm test |
Mofanana ndi npm run dist kuphatikiza imayesa mayeso kwanuko |
npm run docs |
Amamanga ndi kulumikiza CSS ndi JavaScript ya zolemba. Kenako mutha kuyendetsa zolemba kwanuko kudzera pa npm run docs-serve . |
Thamangani npm run
kuti muwone zolemba zonse za npm.
Bootstrap imagwiritsa ntchito Autoprefixer (yophatikizidwa munjira yathu yomanga) kuti ingowonjezera zoyambira zamalonda kuzinthu zina za CSS panthawi yomanga. Kuchita izi kumatipulumutsa nthawi ndi kachidindo potilola kuti tilembe zigawo zazikulu za CSS nthawi imodzi ndikuchotsa kufunikira kwa osakaniza ogulitsa monga omwe amapezeka mu v3.
Timasunga mndandanda wa asakatuli omwe amathandizidwa kudzera mu Autoprefixer mu fayilo ina mkati mwa GitHub yathu. Onani /package.json kuti mumve zambiri.
Kuyendetsa zolemba zathu kwanuko kumafuna kugwiritsa ntchito Jekyll, jenereta yosinthika yokhazikika yomwe imatipatsa: zoyambira zimaphatikizapo, mafayilo ozikidwa pa Markdown, ma templates, ndi zina zambiri. Nayi momwe mungayambitsire:
- Thamangani pakukhazikitsa zida pamwambapa kuti muyike Jekyll (womanga webusayiti) ndi zodalira zina za Ruby ndi
bundle install
. - Kuchokera pamndandanda wa mizu
/bootstrap
, thamanganinpm run docs-serve
mu mzere wolamula. - Tsegulani
http://localhost:9001
msakatuli wanu, ndipo voilà.
Dziwani zambiri za kugwiritsa ntchito Jekyll powerenga zolemba zake .
Mukakumana ndi zovuta pakuyika zodalira, chotsani mitundu yonse yodalira zam'mbuyomu (zapadziko lonse lapansi komanso zam'deralo). Kenako, bwerezaninso npm install
.