xirmo mareegaha
Baro sida loogu daro Bootstrap mashruucaaga adoo isticmaalaya Webpack 3.
Ku rakib bootstrap sida moduleka Node.js adoo isticmaalaya npm.
Soo deji Bootstrap JavaScript adiga oo ku dara khadkan barta laga soo galo abkaaga (sida caadiga ah index.js
ama app.js
):
Haddii kale, waxaad soo dejisan kartaa plugins si gaar ah haddii loo baahdo:
Bootstrap waxay ku xiran tahay jQuery iyo Popper , kuwaas waxaa lagu qeexay sida peerDependencies
, tani waxay la macno tahay inaad hubiso inaad ku darto labadaba package.json
isticmaalkaaga npm install --save jquery popper.js
.
Si aad ugu raaxaysato kartida buuxda ee Bootstrap oo aad u habaynayso baahiyahaaga, isticmaal faylasha isha qayb ka mid ah habka xidhidhiyaha mashruucaaga.
Marka hore, samee kaaga _custom.scss
oo isticmaal si aad u tirtirto doorsoomayaasha caadadii ee ku dhex jira . Ka dib, isticmaal faylkaaga ugu weyn ee Sass si aad u soo dejiso doorsoomayaashaada gaarka ah, oo ay ku xigto Bootstrap:
Si Bootstrap loo ururiyo, hubi inaad rakibtay oo aad isticmaashid ralayaasha loo baahan yahay: sass-loader , postcss-loader oo leh Autoprefixer . Habaynta ugu yar, isku xidhka xidhxidhkaaga webka waa inuu ku jiraa xeerkan ama wax la mid ah:
Haddii kale, waxaad isticmaali kartaa Bootstrap ee diyaarka u ah in la isticmaalo CSS adigoo si fudud ugu daraya khadkan barta laga soo galo mashruucaaga:
Xaaladdan oo kale waxaad u isticmaali kartaa qaanuunkaaga jira css
adigoon wax isbeddel gaar ah ku samayn habaynta xirmada webka, marka laga reebo inaadan u baahnayn sass-loader
kaliya -loader iyo css-loader .