Add SASS to create-react-app project with react-app-rewired
npm install react-app-rewire-sass-ruleAdd SASS to your creat-react-app project without ejecting
for craco
Inspired by react-app-rewire-scss. It has withRuleOptionswhich allows you to configure the rule options except test
``bash`
$ yarn add react-app-rewired react-app-rewire-sass-rule -D
$ npm install react-app-rewired react-app-rewire-sass-rule --save-dev
javascript
/ config-overrides.js /
const SassRuleRewirer = require('react-app-rewire-sass-rule');// Basic
module.exports = function override(config, env) {
config = new SassRuleRewirer()
.rewire(config, env);
return config;
}
// Advanced
module.exports = function override(config, env) {
config = new SassRuleRewirer()
.withRuleOptions({...})
.withLoaderOptions({...})
.rewire(config, env);
return config;
}
``