Using Sass/Scss with React App (create-react-app)

Zohaib Ijaz
Apr 12, 2018 · 1 min read

Folder Structure

/
README.md
node_modules/
package.json
public/
index.html
favicon.ico
src/
App.js
App.test.js
index.js
styles/
/components
main.scss
- yarn add -D react-app-rewired
- yarn add -D react-app-rewire-sass-modules
- yarn add -D sass-loader
- yarn add -D node-sass
{
"start": "react-scripts start",
"build": "react-scripts build"
}

to

{
"start": "react-app-rewired start",
"build": "react-app-rewired build"
}
const rewireSass = require('react-app-rewire-sass-modules');

module.exports = function override(config, env) {
config = rewireSass(config, env);
return config;
}

Zohaib Ijaz

Written by

Sr. Software Engineer | Python/Javascript | github/mzohaibqc | mzohaib.qc@gmail.com

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade