Svetuka kune chikuru content Svetuka kuenda kudocs navigation
in English

Batsira

Batsira kugadzira Bootstrap nemagwaro edu kuvaka zvinyorwa uye bvunzo.

Tooling setup

Bootstrap inoshandisa npm zvinyorwa kuvaka zvinyorwa uye kuunganidza mafaera epamhepo. Yedu package.json inogara aya mascript ekunyora kodhi, kumhanya bvunzo, nezvimwe. Izvi hazvina kuitirwa kushandiswa kunze kwedura redu uye zvinyorwa.

Kuti ushandise yedu yekuvaka sisitimu uye kumhanyisa zvinyorwa zvedu munharaunda, iwe unozoda kopi yeBootstrap's source mafaera uye Node. Tevera nhanho idzi uye iwe unofanirwa kunge wakagadzirira kuzunungusa:

  1. Dhawunirodha uye isa Node.js , iyo yatinoshandisa kugadzirisa zvatinovimba nazvo.
  2. Pamwe dhawunirodha masosi eBootstrap kana forogo Bootstrap's repository .
  3. Enda kumudzi /bootstrapwedhairekitori uye mhanya npm installkuti uise edu emunharaunda anotsamira akanyorwa mu package.json .

Kana wapedza, unokwanisa kumhanyisa mirairo yakasiyana-siyana yakapihwa kubva kumutsara wekuraira.

Kushandisa npm zvinyorwa

Yedu package.json inosanganisira akawanda mabasa ekugadzira chirongwa. Mhanya npm runkuti uone ese npm zvinyorwa mune yako terminal. Mabasa ekutanga anosanganisira:

Basa Tsanangudzo
npm start Inounganidza CSS neJavaScript, inovaka zvinyorwa, uye inotanga sevha yemunharaunda.
npm run dist Inogadzira dist/dhairekitori nemafaira akaunganidzwa. Inoda Sass , Autoprefixer , uye terser .
npm test Inoita bvunzo munharaunda mushure mekuitanpm run dist
npm run docs-serve Inovaka uye inomhanyisa zvinyorwa munzvimbo.
Tanga neBootstrap kuburikidza nenpm neyekutanga chirongwa chedu! Musoro kune twbs/bootstrap-npm-starter template repository kuti uone maitiro ekuvaka uye kugadzirisa Bootstrap mune yako wega npm purojekiti. Inosanganisira Sass compiler, Autoprefixer, Stylelint, PurgeCSS, uye Bootstrap Icons.

Sass

Bootstrap inoshandisa Dart Sass kuunganidza yedu Sass source mafaera muCSS mafaera (anosanganisirwa mune yedu kuvaka maitiro), uye isu tinokurudzira kuti uite zvimwe chete kana iwe uri kuunganidza Sass uchishandisa yako wega pombi. Isu takamboshandisa Node Sass yeBootstrap v4, asi LibSass nemapakeji akavakirwa pamusoro payo, kusanganisira Node Sass, zvino adzikiswa .

Dart Sass inoshandisa kutenderera chaiko kwegumi uye nekuda kwezvikonzero zvakanaka haitenderi kugadzirisa kukosha uku. Isu hatidzikisire iyi chaiyo panguva yekuenderera mberi nekugadziridzwa kweCSS yedu yakagadzirwa, senge panguva yekumisikidza, asi kana wasarudza kudaro tinokurudzira kuti uchengetedze nemazvo kanokwana 6 kudzivirira nyaya nebrowser rounding.

Autoprefixer

Bootstrap inoshandisa Autoprefixer (inosanganisirwa mune yedu yekuvaka maitiro) kuti iwedzere otomatiki prefixes kune dzimwe CSS zvivakwa panguva yekuvaka. Kuita izvi kunotichengetera nguva uye kodhi nekutibvumira kunyora zvikamu zvakakosha zveCSS yedu nguva imwe chete tichibvisa kudiwa kwemusanganiswa wevatengesi seanowanikwa muv3.

Isu tinochengetedza runyorwa rwemabhurawuza anotsigirwa kuburikidza neAutoprefixer mune yakaparadzana faira mukati meGitHub yedu repository. Ona .browserslistrc kuti uwane ruzivo.

RTLCSS

Bootstrap inoshandisa RTLCSS kugadzirisa yakaunganidzwa CSS uye kuishandura kuRTL - kunyanya kutsiva yakachinjika nzira inoziva zvivakwa (semuenzaniso. padding-left) Zvinotibvumira kungonyora CSS yedu kamwechete uye kuita madiki tweaks tichishandisa RTLCSS kutonga uye kukosha kwemirairo.

Zvinyorwa zvemunharaunda

Kumhanyisa zvinyorwa zvedu munharaunda kunoda kushandiswa kweHugo, iyo inoiswa kuburikidza nehugo-bin npm package. Hugo inokurumidza kukurumidza uye yakawedzera static saiti jenareta inotipa: zvakakosha zvinosanganisira, Markdown-based mafaera, matemplate, nezvimwe. Heino maitiro ekutanga:

  1. Mhanya nekuseta kwekushandisa kumusoro kuti uise zvese zvinotsamira.
  2. Kubva pamudzi /bootstrapwedhairekitori, mhanya npm run docs-servemumutsara wekuraira.
  3. Vhura http://localhost:9001/mubrowser yako, uye voilà.

Dzidza zvakawanda nezvekushandisa Hugo nekuverenga zvinyorwa zvayo .

Kugadzirisa matambudziko

Kana iwe ukasangana nezvinetso nekuisa zvinotsamira, bvisa ese ekare anoenderana neshanduro (yepasirese neyemuno). Zvadaro, dzokorora npm install.