I am trying to configure Shopify Hydrogen V2 with LESS (or at least CSS) modules, so I can encapsulate component styles that are only loaded on demand.
Desired usage:
import styles from "./style.module.less"
const ComponentName = () => (
<div className={styles.ComponentName}>Content</div>
);
export default ComponentName;
So far I only found this in the documentation, but it does not seem to be up-to-date: it says you should edit the Vite config file with an experimental feature, but it seems like Hydrogen V2 does not even use Vite anymore as they direct you to remove it.
Has anyone configured it to work? Is there any source I missed?