Urubuga
Wige uburyo washyira Bootstrap mumushinga wawe ukoresheje Webpack.
Gushyira Bootstrap
Shyiramo bootstrap nka Node.js module ukoresheje npm.
Kuzana JavaScript
Kuzana JavaScript ya Bootstrap wongeyeho uyu murongo aho porogaramu yawe yinjira (mubisanzwe index.js
cyangwa app.js
):
Ubundi, urashobora gutumiza amacomeka kugiti cye nkuko bikenewe:
Bootstrap iterwa na jQuery na Popper , ibi bisobanuwe nk peerDependencies
, ibi bivuze ko ugomba gukora ibishoboka byose kugirango wongere byombi mubyo package.json
ukoresha npm install --save jquery popper.js
.
Kuzana Imisusire
Kuzana Sass Yateguwe
Kugirango wishimire ubushobozi bwuzuye bwa Bootstrap kandi uyitondere kubyo ukeneye, koresha dosiye yinkomoko nkigice cyumushinga wawe uhuza.
Ubwa mbere, kora ibyawe _custom.scss
kandi ubikoreshe kugirango uhishe ibyubatswe muburyo bwihariye . Noneho, koresha dosiye yawe nkuru ya Sass kugirango utumize ibintu byahinduwe, hanyuma ukurikire Bootstrap:
Kugirango Bootstrap ikusanye, menya neza ko ushyiraho kandi ukoreshe ibikenerwa bisabwa: sass-umutware , postcss- umutware hamwe na Autoprefixer . Hamwe nimikorere mike, webpack config yawe igomba gushyiramo iri tegeko cyangwa bisa:
Kuzana CSS Yakozwe
Ubundi, urashobora gukoresha Bootstrap yiteguye-gukoresha-CSS wongeyeho uyu murongo aho umushinga wawe winjirira:
Muri iki kibazo, ushobora gukoresha amategeko yawe asanzweho css
nta gihindutse kidasanzwe kuri webpack config, usibye ko udakeneye sass-loader
gusa imiterere-umutwaro na css-umutwaro .