Source

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. Nghena eka /bootstrapxikombo xa timitsu ivi u tsutsuma npm installku nghenisa swititshege swa hina swa laha kaya leswi xaxametiweke eka package.json .
  3. Nghenisa Ruby , nghenisa Bundler hi gem install bundler, ivi eku heteleleni u tirhisa bundle install. Leswi swi ta nghenisa hinkwaswo leswi titshegeke hi Ruby, swo tanihi Jekyll na ti-plugin.
    • Vatirhisi va Windows: Hlaya nkongomiso lowu ku endla leswaku Jekyll yi tirha handle ka swiphiqo.

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 swileriso na mintirho leyi landzelaka:

Ntirho Nhlamuselo
npm run dist npm run distyi tumbuluxa /dist/xikombo lexi nga ni tifayela leti hlengeletiweke. Tirhisa Sass , Autoprefixer na UglifyJS .
npm test Same as npm run distplus yi fambisa swikambelo laha tikweni
npm run docs Ku aka na ku lints CSS na JavaScript ya ti docs. Kutani u nga ha fambisa matsalwa ya laha kaya hi ku tirhisa npm run docs-serve.

Tsutsuma npm runku vona switshuriwa hinkwaswo swa npm.

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.

Maphepha ya ndhawu

Ku fambisa matsalwa ya hina laha tikweni swi lava ku tirhisiwa ka Jekyll, jeneretara ya sayiti leyi nga cinciki leyi cinca-cincaka hi ndlela leyinene leyi hi nyikaka: swi katsa swa xisekelo, tifayela leti sekeriweke eka Markdown, tithempleyiti, na swin’wana. Hi leyi ndlela yo swi sungula:

  1. Tsutsuma hi ku tirhisa xiyimiso xa switirhisiwa laha henhla ku nghenisa Jekyll (muaki wa sayiti) na swin’wana leswi titshegeke hi Ruby hi bundle install.
  2. Ku suka eka xikombo xa timitsu /bootstrap, tsutsuma npm run docs-serveeka layini ya swileriso.
  3. Pfula http://localhost:9001eka browser ya wena, ivi u voilà.

Dyondza swo tala hi ku tirhisa Jekyll 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.