In a workspace, if the vue project folder is not first place in this workspace, webpack aliases doesn't work, so go to definition can not work.
// jsconfig.json
{
"include": [
"./src/**/*"
],
"exclude": [
"node_modules",
"dist"
],
"compilerOptions": {
"checkJs": true,
"baseUrl": ".",
"paths": {
"@/*": [
"./client/*"
]
}
}
}
Now, open Home.vue from workspace A , select Counter and go to definition works. But in workspace B, go to definition doesn't work.


Maybe jsconfig.json not work?
Looks like we have the same problem.
In a workspace setup, vetur autocompletes from the first project jsconfig.json
My setup:
In ui lib in any *.vue file I get autocomplete like this: (which is a config from app project)

However, this works normally for js files (presumably because because i did not configure vetur for js files so regular vscode path works for js files)

Looks like we have the same problem.
In a workspace setup, vetur autocompletes from the first project jsconfig.jsonMy setup:
app project
- jsconfig.json
ui lib
- jsconfig.json
In ui lib in any
*.vuefile I get autocomplete like this: (which is a config from app project)
However, this works normally for js files (presumably because because i did not configure vetur for js files so regular vscode path works for js files)
Yep, the js files work well.
BTW, the ESLint extension for VSCode has a eslint.workingDirectories option to solve this similar issue.
microsoft/vscode-eslint
This is the same underlying issue as https://github.com/vuejs/vetur/issues/815. Glad you found a temporary solution.
Most helpful comment
BTW, the ESLint extension for VSCode has a
eslint.workingDirectoriesoption to solve this similar issue.microsoft/vscode-eslint