To use @/
- Install types/node: npm i types/node
- Go to vite.config : import path from ‘path’ & add below code into config
resolve: {
alias: [{find:"@", replacement: path.resolve(__dirname, 'src')}]
}
- Go to ts.config : add below code into compilerOptions:
"paths": {
"@/*": ["./src/*"]
},