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