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
.
Ogaysii haddii aad dooratay inaad soo dejiso plugins si gaar ah , waa inaad sidoo kale rakibtaa dhoofinta-loader
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 sass-ka ugu weyn 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 u diyaarsan in la isticmaalo css adiga oo si fudud ugu daraya khadkan barta laga soo galo mashruucaaga:
Xaaladdan oo kale waxaad u isticmaali kartaa qaanuunkaaga jira adiga oo css
aan wax isbeddel gaar ah ku samayn habaynta xirmada webka marka laga reebo uma baahnid sass-loader
kaliya style-loader iyo css-loader .