Optimization
Deduplicate Critical CSS
When using CSS Modules there can a problem arise which duplicates CSS Rules whenever the component is imported. To mitigate that and not having multiple same rules in the HTML we added the following flag, which optimizes the Styles before inlining it in the HTML.
{
"optimization": {
"deduplicateCriticalCSS": true
}
}
info
The optimization needs resources and can depending on the size of your project be worse than leaving the dupes in there.
Minify with SWC
SWC the new rust compiler allows now also minification directly. It is still early and not guaranteed to work. For it to work the normal minify also needs to be set to true.
{
"experimental": {
"minify": true
}
}