Add the configuration

In node_modules/react – scripts/config/webpack config. Dev. The rules of js configuration file handle sass files and modules: true this configuration.

Method of use

import styles from './index.scss'
...
<div class={styles.xxx}></div>
...
Copy the code