Tsim cov cuab yeej
Kawm paub siv Bootstrap's suav nrog npm scripts los tsim peb cov ntaub ntawv, sau cov lej code, khiav kev xeem, thiab ntau dua.
Bootstrap siv NPM scripts rau nws txoj kev tsim. Peb package.json suav nrog txoj hauv kev yooj yim rau kev ua haujlwm nrog lub moj khaum, suav nrog kev sau cov lej, kev xeem khiav, thiab lwm yam.
Txhawm rau siv peb cov txheej txheem tsim thiab khiav peb cov ntaub ntawv hauv zos, koj yuav xav tau ib daim qauv ntawm Bootstrap cov ntaub ntawv thiab Node. Ua raws li cov kauj ruam no thiab koj yuav tsum npaj kom pob zeb:
- Download tau thiab nruab Node.js , uas peb siv los tswj peb cov kev vam meej.
- Coj mus rau hauv paus
/bootstrap
directory thiab khiavnpm install
mus rau nruab peb lub zos dependencies teev nyob rau hauv package.json . - Nruab Ruby , nruab Bundler nrog
gem install bundler
, thiab thaum kawg khiavbundle install
. Qhov no yuav nruab tag nrho Ruby kev vam khom, xws li Jekyll thiab plugins.- Cov neeg siv Windows: Nyeem phau ntawv qhia no kom tau Jekyll nce thiab khiav yam tsis muaj teeb meem.
Thaum ua tiav, koj yuav muaj peev xwm khiav ntau yam lus txib muab los ntawm kab hais kom ua.
Peb package.json suav nrog cov lus txib thiab cov haujlwm hauv qab no:
Ua haujlwm | Kev piav qhia |
---|---|
npm run dist |
npm run dist tsim cov /dist directory nrog compiled ntaub ntawv. Siv Sass , Autoprefixer , thiab UglifyJS . |
npm test |
Ib yam li npm run dist ntxiv rau nws khiav kev xeem hauv zos |
npm run docs |
Tsim thiab lints CSS thiab JavaScript rau docs. Tom qab ntawd koj tuaj yeem khiav cov ntaub ntawv hauv zos ntawm npm run docs-serve . |
Khiav npm run
mus saib tag nrho npm scripts.
Bootstrap siv Autoprefixer (suav nrog hauv peb cov txheej txheem tsim) kom tau txais kev ntxiv cov neeg muag khoom ua ntej rau qee cov khoom CSS thaum tsim lub sijhawm. Ua li ntawd txuag peb lub sijhawm thiab cov lej los ntawm kev tso cai rau peb sau qhov tseem ceeb ntawm peb CSS ib zaug thaum tshem tawm qhov xav tau ntawm cov neeg muag khoom mixins zoo li cov pom hauv v3.
Peb tuav cov npe ntawm cov browsers txhawb nqa los ntawm Autoprefixer hauv cov ntaub ntawv sib cais hauv peb qhov chaw cia GitHub. Saib /package.json kom paub meej.
Kev khiav peb cov ntaub ntawv hauv zos yuav tsum tau siv Jekyll, lub tshuab hluav taws xob hloov pauv hloov tau yooj yim uas muab rau peb: yooj yim suav nrog, Markdown-raws li cov ntaub ntawv, cov qauv, thiab ntau dua. Nov yog yuav ua li cas pib nws:
- Khiav los ntawm cov cuab yeej teeb tsa saum toj no rau nruab Jekyll (lub vev xaib tsim) thiab lwm yam Ruby dependencies nrog
bundle install
. - Los ntawm lub hauv paus
/bootstrap
directory, khiavnpm run docs-serve
hauv kab hais kom ua. - Qhib
http://localhost:9001
koj lub browser, thiab voilà.
Kawm ntxiv txog kev siv Jekyll los ntawm kev nyeem nws cov ntaub ntawv .
Yog tias koj ntsib teeb meem nrog kev txhim kho kev vam khom, tshem tawm tag nrho cov kev vam meej yav dhau los (ntiaj teb thiab hauv zos). Tom qab ntawd, rov ua dua npm install
.