Skip to content

Go to definition: add mainFields to go to es6 code #46563

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
dan-kez opened this issue Mar 26, 2018 · 1 comment
Closed

Go to definition: add mainFields to go to es6 code #46563

dan-kez opened this issue Mar 26, 2018 · 1 comment
Assignees
Labels
javascript JavaScript support issues typescript Typescript support issues upstream Issue identified as 'upstream' component related (exists outside of VS Code)

Comments

@dan-kez
Copy link

dan-kez commented Mar 26, 2018

  • VSCode Version: Version 1.21.1 (1.21.1)
  • OS Version: Sierra 10.12.6 (16G1114)

Steps to Reproduce:

  1. Add a package with both a main and module or jsnext:main field. (ex. yarn add react-table)
  2. Import the package in a js file. Command click an import. This will go to the import under the main field.

Desired Behavior:

The ability to configure which fields to resolve to (e.g. webpack's mainFields implementation).

Desired configuration:

{
    "compilerOptions": {
        "mainFields": ["module", "main"]
    }
}

Reasoning:

  1. If you are resolving module during webpack build, it would be helpful to jump to the code you are actually executing.
  2. This will help support monorepos (e.g. lerna based) so that you can jump to the source code definition rather than the compiled code. This will also help with peek / proptypes since they won't be compiled out.

I'm happy to provide more details!

@vscodebot vscodebot bot added the javascript JavaScript support issues label Mar 26, 2018
@mjbvz
Copy link
Collaborator

mjbvz commented Mar 26, 2018

Thanks!

Looks like this is already tracked upstream by microsoft/TypeScript#21423

@mjbvz mjbvz closed this as completed Mar 26, 2018
@mjbvz mjbvz added upstream Issue identified as 'upstream' component related (exists outside of VS Code) typescript Typescript support issues labels Mar 26, 2018
@vscodebot vscodebot bot locked and limited conversation to collaborators May 10, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
javascript JavaScript support issues typescript Typescript support issues upstream Issue identified as 'upstream' component related (exists outside of VS Code)
Projects
None yet
Development

No branches or pull requests

2 participants