This project was bootstrapped with Create React App.
This repo is a basic create-react-app instance that has had the following changes:
- Ejected
- Components folder and pages folder added
- Added SCSS preLoaders
- Mapped SCSS files to a stub for jest testing files that import SCSS files
- Good for making sure everything is up to date
create-react-app project-name
cd project-name
npm run eject
npm install sass-loader node-sass --save-dev
Import the loaders to make sure SCSS compiles
Add to the preLoaders array in /config/webpack.config.dev.js
and /config/webpack.config.prod.js
{
test: /\.scss$/,
include: paths.appSrc,
loaders: ["style", "css", "sass"]
}
Lastly, to ignore SCSS imports for testing
Add to moduleNameMapper in package.json
"^.+\\.scss$": "<rootDir>/config/jest/CSSStub.js"