CSS modules from SASS in the Razzle

373 Views Asked by At

I use the Razzle which has a pretty good support for the CSS modules. It uses just the Webpack with common CSS Loader, so it is configurable the same way. My trouble is that I'm not able to use SCSS files the same way.

Works:

import styles from "./App.module.css";
...   <div className={styles.foo}>

Doesn't work

import sasses from "./App.module.scss";
...  <div className={sasses.foo}>

My configuration:

module.exports = {
  plugins: [
    {
      name: "scss",
      options: {
        css: {
          modules: true
        }
      }
    },

How to configure the Razzle to use the SCSS modules?

0

There are 0 best solutions below