aze3ma / react-app-rewire-scss

Configure SASS in Create React App without ejecting

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Rewire create-react-app to use SASS!

You might not need this rewire, Create React App added guide about how to add Sass support to CRA without the need of ejecting, but I just updated an existing deprecated package from react-app-rewired so in case you don't like to locally watch your sass files this is the solution. See Adding a CSS Preprocessor but in case you want to injecting Sass instead of the normal watch files approach CRA represnting using node-sass-chokidar

Install

$ yarn add react-app-rewired react-app-rewire-scss -D
$ npm install react-app-rewired react-app-rewire-scss --save-dev

Add it to your project

const rewireSass = require('react-app-rewire-scss');

/* config-overrides.js */
module.exports = function override(config, env) {
  config = rewireSass(config, env);
  // with loaderOptions
  // config = rewireSass.withLoaderOptions(someLoaderOptions)(config, env);
  return config;
}

About

Configure SASS in Create React App without ejecting

License:MIT License


Languages

Language:JavaScript 100.0%