CSS Modules aren't tree shaked
StarpTech opened this issue · comments
Dustin Deus commented
I'd expect that unused CSS is removed from the build. This is one big advantage of CSS Modules.
Example:
Input
import styles from './index.module.css';
export default function Button() {
return <div className={styles.button}></div>
}
.button {
width: auto;
}
.unused {
width: auto;
padding: 3px;
}
Output
.index-module_button__3X3pB {
width: auto;
}
.index-module_unused__2wMHH {
width: auto;
}
.index-module_bar-1__3ZOpQ .bar .index-module_bar-2__rsPcN {
color: white;
}
.page {
padding: 20px;
}