Reputation: 233
I used to implement alias feature , like this:
resolve: {
alias: {
"@": path.resolve(__dirname, "src"),
},
},
but this feature let vscode can't go to definition file by Ctrl+Click
.
How to fix this?
Upvotes: 7
Views: 5843
Reputation: 1044
Create or edit a jsconfig.json
/tsconfig.json
file at the root of your project and add the "paths" option:
{
"compilerOptions": {
"baseUrl": ".",
"paths": {
"@/*": ["./src/*"]
}
}
}
Upvotes: 19