Atyantik / react-pwa

An upgradable boilerplate for Progressive web applications (PWA) with server side rendering, build with SEO in mind and achieving max page speed and optimized user experience.
https://www.reactpwa.com
MIT License
2.57k stars 303 forks source link

Using sass files #121

Closed ldevalbray closed 5 years ago

ldevalbray commented 5 years ago

In the documentation, you don't specify how to use the sass middleware. I followed those steps : https://www.reactpwa.com/docs/en/plugin-sass.html But importing the .scss files like a normal .css file does not work. Any idea ?

tirthbodawala commented 5 years ago

@ldevalbray you might want to check the file https://github.com/Atyantik/react-pwa/blob/master/src/client.js It shows you need to import sass inside client.js or if the sass is component specific you can include it inside a particular component, just like normal css. Example:

import React from 'react';
import styles from './local-styles.scss';

export default () => (
  <h1 className={styles["title"]} >This is a title</h1>
);

Hope that answers your question

ldevalbray commented 5 years ago

I tried this way, but I get this error : "“You may need an appropriate loader to handle this file type”. Even when I followed your steps when adding the sass plugin.

Thank you for your time and reactivity !