Testing CSS Bundle Assembly in Webpack
Let's test assembling CSS into a separate bundle. Let's say we have two CSS files.
First:
body {
background: red;
}
Second:
p {
color: green;
}
We import them to the entry point:
import './styles1.css';
import './styles2.css';
The project build command will collect everything into a separate file named main.css:
body {
background: red;
}
p {
color: green;
}
Import three CSS files to your entry point.
Build in development mode. Inspect the bundle's CSS file.
Build in production mode. Inspect the bundle's CSS file.