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.
Kupanga zida
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.
Kugwiritsa ntchito npm scripts
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 UglipJS . |
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.
Autoprefixer
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 .browserslistrc kuti mumve zambiri.
Zolemba zakomweko
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 .
Kusaka zolakwika
Mukakumana ndi zovuta pakukhazikitsa zodalira, chotsani mitundu yonse yodalira zam'mbuyomu (zapadziko lonse lapansi komanso zapafupi). Kenako, bwerezaninso npm install
.