Tlula eka nhlokomhaka-nkulu Tlula eka docs navigation
in English

Aka switirhisiwa

Dyondza ndlela yo tirhisa swikripti swa npm leswi katsekaka swa Bootstrap ku aka matsalwa ya hina, ku hlengeleta khodi ya xihlovo, ku fambisa swikambelo, na swin’wana.

Ku lulamisiwa ka switirhisiwa

Bootstrap yi tirhisa switshuriwa swa npm eka sisiteme ya yona yo aka. Package.json ya hina yi katsa tindlela to olova to tirha na rimba, ku katsa na ku hlengeleta khodi, ku fambisa swikambelo, na swin’wana.

Ku tirhisa sisiteme ya hina yo aka na ku fambisa matsalwa ya hina ya laha kaya, u ta lava khopi ya tifayela ta xihlovo ta Bootstrap na Node. Landzelela magoza lawa naswona u fanele ku va u lunghekele ku rocker:

  1. Download and install Node.js , leyi hi yi tirhisaka ku lawula swilo leswi hi titshegeke hi swona.
  2. Ku nga ha va ku kopa swihlovo swa Bootstrap kumbe ku forokela vuhlayiselo bya Bootstrap .
  3. Nghena eka /bootstrapxikombo xa timitsu ivi u tsutsuma npm installku nghenisa swititshege swa hina swa laha kaya leswi xaxametiweke eka package.json .

Loko u hetile, u ta kota ku tirhisa swileriso swo hambana-hambana leswi nyikiweke ku suka eka layini ya swileriso.

Ku tirhisa switshuriwa swa npm

Package.json ya hina yi katsa mintirho yo tala yo hluvukisa phurojeke. Tsutsuma npm runku vona swikripti hinkwaswo swa npm eka theminali ya wena. Mintirho ya nkoka yi katsa:

Ntirho Nhlamuselo
npm start Ku hlengeleta CSS na JavaScript, ku aka matsalwa, na ku sungula sevha ya laha kaya.
npm run dist Ku tumbuluxa dist/xikombo lexi nga ni tifayela leti hlengeletiweke. Swi lava Sass , Autoprefixer na terser .
npm test Ku fambisa swikambelo laha tikweni endzhaku ko tsutsumanpm run dist
npm run docs-serve Ku aka no fambisa matsalwa ya laha kaya.
Sungula hi Bootstrap hi ku tirhisa npm hi phurojeke ya hina yo sungula! Khoma ndlela eka vuhlayiselo bya xifaniso xa twbs/bootstrap-npm-starter ku vona ndlela yo aka na ku lulamisa Bootstrap eka phurojeke ya wena ya npm. Ku katsa na muhlengeleti wa Sass, Autoprefixer, Stylelint, PurgeCSS, na Swifaniso swa Bootstrap.

Sass

Bootstrap yi tirhisa Dart Sass ku hlengeleta tifayela ta hina ta xihlovo xa Sass eka tifayela ta CSS (leswi katsekaka eka endlelo ra hina ro aka), naswona hi ringanyeta leswaku u endla leswi fanaka loko u hlengeleta Sass hi ku tirhisa phayiphi ya wena ya nhundzu. Khale hi tirhisa Node Sass eka Bootstrap v4, kambe LibSass na tiphasela leti akiweke ehenhla ka yona, ku katsa na Node Sass, sweswi swi nga ha tirhisiwi .

Dart Sass yi tirhisa ku rhendzeleka ka 10 naswona hikwalaho ka swivangelo swa vukorhokeri a yi pfumeleli ku lulamisiwa ka ntikelo lowu. A hi hunguti ku kongoma loku hi nkarhi wa ku ya emahlweni ka ku lulamisiwa ka CSS ya hina leyi endliweke, ku fana na hi nkarhi wa ku hunguta, kambe loko u hlawurile ku endla tano hi ringanyeta ku hlayisa ku kongoma ka kwalomu ka 6 ku sivela timhaka ta ku rhendzeleka ka xihlamusela-marito.

Xihlawulekisi xa ku tisungulela

Bootstrap yi tirhisa Autoprefixer (leyi katsiweke eka endlelo ra hina ro aka) ku engetela hi ku tisungulela swirhangi swa vaxavisi eka swihlawulekisi swin’wana swa CSS hi nkarhi wo aka. Ku endla tano swi hi hlayisela nkarhi na khodi hi ku hi pfumelela ku tsala swiphemu swa nkoka swa CSS ya hina nkarhi wun’we loko hi ri karhi hi herisa xilaveko xa ti- mixin ta vaxavisi to fana na leti kumekaka eka v3.

Hi hlayisa nxaxamelo wa swihlamusela-marito leswi seketeriwaka hi ku tirhisa Autoprefixer eka fayili leyi hambaneke endzeni ka vuhlayiselo bya hina bya GitHub. Vona .browserslistrc ku kuma vuxokoxoko.

RTLCSS yi vula leswaku

Bootstrap yi tirhisa RTLCSS ku tirhisa CSS leyi hlengeletiweke no yi hundzuluxela eka RTL – hi xisekelo yi siva swihlawulekisi swa horizontal direction aware (eg. padding-left) hi leswi hambaneke na swona. Swi hi pfumelela ntsena ku tsala CSS ya hina nkarhi wun’we na ku endla swintshuxo leswitsongo hi ku tirhisa vulawuri bya RTLCSS na swiletelo swa nkoka .

Maphepha ya ndhawu

Ku fambisa matsalwa ya hina laha tikweni swi lava ku tirhisiwa ka Hugo, leyi kumaka ku nghenisiwa hi ku tirhisa phasela ra hugo-bin npm. Hugo i blazingly fast and quite extensible static site generator leyi hi nyikaka: ya xisekelo yi katsa, tifayela leti simekiweke eka Markdown, tithempleyiti, na swin’wana. Hi leyi ndlela yo swi sungula:

  1. Tsutsuma hi ku tirhisa xitirhisiwa lexi nga laha henhla ku nghenisa hinkwaswo leswi titshegeke.
  2. Ku suka eka xikombo xa timitsu /bootstrap, tsutsuma npm run docs-serveeka layini ya swileriso.
  3. Pfula http://localhost:9001/eka browser ya wena, ivi u voilà.

Dyondza swo tala hi ku tirhisa Hugo hi ku hlaya matsalwa ya yona .

Ku lulamisa swiphiqo

Loko u fanele ku hlangana na swiphiqo swo nghenisa ku titshega, susa tivhidiyo hinkwato ta ku titshega ta khale (ya misava hinkwayo na ta laha kaya). Kutani, tlhela u tlanga npm install.