Webpack a ni
Webpack 3 hmanga i project-a Bootstrap telh dan zir rawh.
bootstrap chu Node.js module angin npm hmangin install rawh.
Bootstrap -a JavaScript chu i app entry point-ah he line hi dah la (a tlangpuiin index.js
emaw app.js
):
A nih loh leh, a tul angin plugins pakhat zel i import thei bawk :
Bootstrap hi jQuery leh Popper ah a innghat a , hengte hi hetiang hian an sawifiah a peerDependencies
, hei hian a awmzia chu i package.json
hman danah an pahnih hian add ngei ngei tur a ni tihna a npm install --save jquery popper.js
ni
Bootstrap thiltihtheihna zawng zawng hmang tangkai tur leh i mamawh ang zela siam tur chuan source files te chu i project bundling process ah hmang la.
A hmasa berin nangmah ngeiin siam la, chu chu hmang la, built-in custom variables te_custom.scss
chu override rawh . Tichuan, i main Sass file hmangin i custom variable te chu import la, Bootstrap hmangin i rawn lut leh ang:
Bootstrap compile tur chuan loader mamawh te chu install leh hman ngei ngei tur a ni: sass-loader , postcss-loader with Autoprefixer . Setup tlem ber nen chuan i webpack config ah hian he rule emaw a ang chi emaw hi a tel tur a ni:
A dang pawhin Bootstrap-a hman theih tura inpeih tawh CSS chu i project entry point-ah he line hi dah maiin i hmang thei bawk ang:
Chutiang a nih chuan i rule awmsa chu webpack config-a siam danglamna bik awm lovin i hmang thei ang , style-loader leh css- loader chauh css
i mamawh loh tih loh chu .sass-loader