Closed hades255 closed 6 hours ago
install react-app-rewired
node module
npm i react-app-rewired
yarn add react-app-rewired
update scripts on package.json
file
"scripts": {
"start": "react-app-rewired start",
"build": "react-app-rewired build",
"test": "react-app-rewired test",
"eject": "react-app-rewired eject"
},
make new file named config-overrides.js
on the root directory
const { configPaths, alias } = require('react-app-rewire-alias')
module.exports = alias(configPaths('./jsconfig.json'))
make new file named jsconfig.json
on the root directory
{
"compilerOptions": {
"paths": {
"@icons/*": ["./src/assets/icons/*"]
}
},
"include": ["src"]
}
use it on the components
import { BellIcon, DownVectorIcon, MarkIcon } from '@icons'
bundle path to make components reusable and flexible to expand