Omukutu gwa yintaneeti
Yiga engeri y'okussaamu Bootstrap mu pulojekiti yo ng'okozesa Webpack 3.
Teeka bootstrap nga module ya Node.js nga okozesa npm.
Yingiza JavaScript ya Bootstrap ng'ogattako layini eno ku kifo app yo w'eyingira (ebiseera ebisinga index.js
oba app.js
):
Ekirala, oyinza okuyingiza plugins kinnoomu nga bwe kyetaagisa:
Bootstrap yesigamye ku jQuery ne Popper , bino bitegeezebwa nga peerDependencies
, kino kitegeeza nti ojja kuba olina okukakasa nti byombi obigatta ku package.json
nkozesa yo npm install --save jquery popper.js
.
Weetegereze nti singa wasalawo okuyingiza plugins kinnoomu , olina n'okuteeka exports-loader
Okunyumirwa obusobozi bwonna obwa Bootstrap n'okugilongoosa okusinziira ku byetaago byo, kozesa fayiro z'ensibuko ng'ekitundu ku nkola ya pulojekiti yo ey'okugatta.
Okusooka, tonda eyiyo _custom.scss
era ogikozese okusazaamu enkyukakyuka ez’ennono ezizimbibwamu . Oluvannyuma, kozesa fayiro yo enkulu eya sass okuyingiza enkyukakyuka zo eza bulijjo, oluvannyuma Bootstrap:
Bootstrap okusobola okukung'aanya, kakasa nti oteeka era okozesa ebitikka ebyetaagisa: sass-loader , postcss-loader ne Autoprefixer . Nga olina okuteekawo okutono, webpack config yo erina okubeeramu etteeka lino oba erifaananako bwetyo:
Ekirala, oyinza okukozesa css ya Bootstrap eyeetegefu okukozesebwa ng’omala kugatta layini eno ku kifo pulojekiti yo w’eyingira:
Mu mbeera eno oyinza okukozesa etteeka lyo eririwo for awatali nkyukakyuka yonna ey'enjawulo ku webpack config okuggyako nga css
teweetaaga style-loader ne css-loader zokka .sass-loader