Yɛ nnwinnade a wɔde bɛyɛ adwuma
Sua sɛnea wode Bootstrap no npm scripts a ɛka ho no bedi dwuma de akyekye yɛn nkrataa, aboaboa source code ano, ayɛ sɔhwɛ ahorow, ne nea ɛkeka ho.
Nnwinnade nhyehyɛe
Bootstrap de NPM scripts di dwuma ma ne dan nhyehyɛe. Yɛn package.json no wɔ akwan a ɛyɛ mmerɛw a wɔfa so de framework no yɛ adwuma, a nea ɛka ho ne code a wɔbɛboaboa ano, sɔhwɛ ahorow a wɔde tu mmirika, ne nea ɛkeka ho.
Sɛ wode yɛn build system no bedi dwuma na woayɛ yɛn documentation no wɔ locally a, wubehia Bootstrap no source files ne Node no bi. Di anammɔn yi akyi na ɛsɛ sɛ woyɛ krado sɛ wobɛwosow:
- Twe na install Node.js , a yɛde di dwuma de hwɛ yɛn dependencies so.
- Kɔ root
/bootstrap
directory no so na tu mmirikanpm install
kɔ instɔl yɛn local dependencies a wɔakyerɛw wɔ package.json mu no. - Install Ruby , instɔl Bundler ne
gem install bundler
, na awiei koraa no tu mmirikabundle install
. Wei bɛ instɔl Ruby dependencies nyinaa, te sɛ Jekyll ne plugins.- Windows dwumadiefoɔ: Kenkan akwankyerɛ yi na ama Jekyll ayɛ adwuma a ɔhaw biara nni ho.
Sɛ wowie a, wobɛtumi ayɛ ahyɛdeɛ ahodoɔ a wɔde ama no afiri ahyɛdeɛ kwan no so.
NPM nkyerɛwde ahorow a wɔde bedi dwuma
Yɛn package.json no ka ahyɛde ne nnwuma a edidi so yi ho:
Adwuma | Nkyerɛmu |
---|---|
npm run dist |
npm run dist yɛ /dist directory no a fael ahorow a wɔaboaboa ano wom. Ɔde Sass , Autoprefixer , ne UglifyJS di dwuma . |
npm test |
Same as npm run dist plus ɛyɛ sɔhwɛ ahorow wɔ mpɔtam hɔ |
npm run docs |
Ɔkyekye na lints CSS ne JavaScript ma docs. Afei wubetumi ayɛ nkrataa no wɔ mpɔtam hɔ denam npm run docs-serve . |
Mmirikatu npm run
kɔhwɛ npm scripts no nyinaa.
Autoprefixer a wɔde di dwuma
Bootstrap de Autoprefixer (a ɛka yɛn adansi nhyehyɛe no ho) di dwuma de ankasa de vendor prefixes ka CSS agyapade binom ho wɔ ɔdansi bere mu. Saa a yɛyɛ no ma yɛkora yɛn bere ne koodu so denam ma a ɛma yetumi kyerɛw yɛn CSS no afã atitiriw prɛko pɛ bere a eyi hia a ɛho hia sɛ yɛde vendor mixins te sɛ nea wohu wɔ v3 no fi hɔ no so.
We maintain the list of browsers supported through Autoprefixer in a separate file within our GitHub repository. See /.browserslistrc for details.
Local documentation
Running our documentation locally requires the use of Jekyll, a decently flexible static site generator that provides us: basic includes, Markdown-based files, templates, and more. Here’s how to get it started:
- Run through the tooling setup above to install Jekyll (the site builder) and other Ruby dependencies with
bundle install
. - From the root
/bootstrap
directory, runnpm run docs-serve
in the command line. - Open
http://localhost:9001
in your browser, and voilà.
Learn more about using Jekyll by reading its documentation.
Troubleshooting
Sɛ wohyia ɔhaw wɔ dependencies instɔlehyɛn mu a, yi dependency nkyerɛaseɛ a atwam no nyinaa (wiase nyinaa ne mpɔtam hɔ). Afei, san tu mmirika bio npm install
.