CSS bundle testēšana Webpack
Pārbaudīsim CSS apvienošanu atsevišķā bundle. Pieņemsim, ka mums ir divi CSS faili.
Pirmais:
body {
background: red;
}
Otrais:
p {
color: green;
}
Importēsim tos entry point:
import './styles1.css';
import './styles2.css';
Projekta build komanda
apvienos visu atsevišķā failā
ar nosaukumu main.css:
body {
background: red;
}
p {
color: green;
}
Importējiet savā entry point trīs CSS failus.
Veiciet build development režīmā. Izpētiet CSS bundle failu.
Veiciet build production režīmā. Izpētiet CSS bundle failu.