I’m been struggling with using meteor with visual studio code, the real problem that annoys me is that intellisense breaks when using absolute imports instead of relative imports:
Eg. using:
import Collections from '/imports/collections/collections.js'
instead of:
import Collections from '../../collections/collections.js'
I prefer using absolute paths because when the project gets bigger, the relative paths get bigger too, and becomes a messy thing.
Has anyone made the meteor absolute import path work with VSCode intellisense (including go to definition)? I’ll really appreciate your help.
Until now I just made this work using the absolute path, but whithout the root slash:
Eg. This works with intellisense and go to definition:
import Collections from 'imports/collections/collections.js'
But in this way, the imports doesn’t work with meteor.
I open an issue in the vscode repository https://github.com/Microsoft/vscode/issues/31408 but they gave me an answer about how to configure paths alias, but the problem is that vscode seems to not play well with the root slash in the path (it seems that is treated as a relative path).
Anyway, I had to return to webstorm, that, although slower, I can use the paths as I want.