I have an app created using vue-cli 3 and I am using Visual Studio as my IDE. I have installed Vetur extension. Unfortunately when I am typing something like that
import Message from '@/components/Message'
VS code does not provide any Intellisense for resolving such an absolute file path. Maybe VS code does not understand that @ maps to 'src' folder in projects created using vue-cli. Does anybody know how to solve that problem?
I will be very grateful for any help.
I have setup jsconfig.json
in following manner and it works
{
"compilerOptions": {
"paths": {
"@/*": [
"src/*"
]
}
}
}
You 'd be needing a jsconfig.json
file for the Intellisense to kick in with webpack aliases. You can check the linked article.
https://medium.com/@justintulk/solve-module-import-aliasing-for-webpack-jest-and-vscode-74007ce4adc9
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With