Webpack ye
Aw ye Bootstrap doncogo dɔn aw ka porozɛ kɔnɔ ni Webpack 3 ye.
Bootstrap sigi sen kan i n’a fɔ Node.js modulu ni npm ye.
Bootstrap ka JavaScript ladon ni nin layini in farali ye i ka porogaramu don yɔrɔ la (a ka c’a la index.js
walima app.js
):
O cogo kelen na, i bɛ se ka plugins (plugin) ladon kelen-kelen i n’a fɔ a mago bɛ cogo min na:
Bootstrap bɛ tali kɛ jQuery ni Popper de la , ninnu ɲɛfɔlen don i n' a fɔ peerDependencies
, o kɔrɔ ye ko i bɛna i jija k' u fila bɛɛ fara i ka package.json
baarakɛcogo npm install --save jquery popper.js
kan .
Walasa ka Bootstrap seko bɛɛ diyabɔ ani k’a kɛ ka kɛɲɛ n’i magow ye, baara kɛ ni source files ye i n’a fɔ i ka poroze ka bundling process dɔ.
Fɔlɔ, i yɛrɛ ta dabɔ _custom.scss
ani ka baara kɛ n’a ye walasa ka ladamu fɛn caman sɛgɛsɛgɛli kɛ . O kɔfɛ, baara kɛ ni i ka Sass filenba ye walasa k’i ka ladamu fɛn caman sɛgɛsɛgɛli kɛ, o kɔfɛ Bootstrap:
Walasa Bootstrap ka se ka dalajɛ, aw ye aw jija ka doni-minɛnw sigi sen kan ani ka baara kɛ ni u ye: sass-loader , postcss-loader ni Autoprefixer . Ni sigicogo fitinin ye, i ka webpack config ka kan ka nin sariya in walima a ɲɔgɔnnaw don a kɔnɔ:
O cogo kelen na, i bɛ se ka baara kɛ ni Bootstrap ka CSS labɛnnen ye baara kama ni i ye nin layini in fara dɔrɔn i ka porozɛ donyɔrɔ kan:
O cogo la i bɛ se ka baara kɛ n’i ka sariya kɔrɔ ye for css
k’a sɔrɔ i ma fɛn kɛrɛnkɛrɛnnenw sɛmɛntiya webpack config kan, fo n’i mago tɛ sass-loader
style -loader ni css-loader dɔrɔn na.