This extension lets you jump to your files, even if they're aliased through webpack, typescript, or other tools. If you don't specify aliases in your vscode workspace config, then it attempts to deduce them by building a virtual directory structure.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
CMD/CTRL + Click, F12, or right click -> Go To Definition on import paths
(optional performance boost): In vscode settings, Editor > Goto Location: Multiple Definitions > goto. This will open the winning result first. It the settings.json, it's "editor.gotoLocation.multipleDefinitions": "goto".
Settings
smart-goto.resolveExtensions: string[] - String array of the extensions you don't have to add the extension to. I recommend to not do things like .css, .scss. You really only want to resolve .js, .jsx, etc.
smart-goto.ignoreFolders: string[] - String array of folders to to parse when creating internal dependency search stream. Default is node_modules and .git.
Information
Sometimes aliases are defined in webpack, Typescript settings, or babel to avoid relative imports. I got tired of having to copy/paste the paths and type it into vscode's fuzzy search for certain projects I was working on.
If you’re not familiar with the concept of aliasing, it turns a file like this:
import React from 'react'
import { connect } from 'react-redux'
import { someConstant } from './../../config/constants'
import MyComponent from './../../../components/MyComponent'
Into this:
import React from 'react'
import { connect } from 'react-redux'
import { someConstant } from 'config/constants'
import MyComponent from 'components/MyComponent'