-
Install the craco dependency:
npm i -D @craco/craco
-
create 'craco.config.js' and past the following:
/* craco.config.js */ const path = require(`path`); module.exports = { webpack: { alias: { "@": path.resolve(__dirname, "src/"), }, }, };
-
Use craco in package.json:
"scripts": { - "start": "npm start", - "build": "npm build", + "start": "craco start", + "build": "craco build", "eject": "react-scripts eject" },
-
You can now use the
@
path alias the same way its used inshadcn/ui
:import { cn } from "@/lib/utils";