Reputation: 8215
I'm working on a ruby on rails application with a react js frontend.
What does the @ signify here
import ProductCard from '@components/search/ProductCard';
Upvotes: 43
Views: 29114
Reputation: 5767
If you are using Typescript (which the tag suggests you are) it's possible to setup "path mapping" in your tsconfig.json
{
"compilerOptions": {
"baseUrl": ".",
"paths": {
"@": ["./src"],
"@/*": ["./src/*"],
"@components": ["./src/components"]
}
}
}
This will create an alias for "@components" that points to a specific folder.
Read more about it here: https://www.typescriptlang.org/docs/handbook/module-resolution.html#path-mapping
It could be a scoped package like @types/xxx
but this is unlikely in the given case.
Upvotes: 60