-
yarn add @craco/craco --dev
-
create
craco.config.js
at the root of your project, and put these in it
module.exports = {
reactScriptsVersion: 'react-scripts',
style: {
sass: {
loaderOptions: {
additionalData: `@import "src/assets/styles/variables/index.scss";`
}
}
}
};
- update
scripts
in thepackage.json
/* package.json */
"scripts": {
- "start": "react-scripts start",
+ "start": "craco start",
- "build": "react-scripts build",
+ "build": "craco build"
- "test": "react-scripts test",
+ "test": "craco test"
}