简体   繁体   English

如何在 lernajs mono repo 中的 VSCode 中“跳转到定义”?

[英]How to "jump to definition" in VSCode in a lernajs mono repo?

I have a lernajs mono repo and writing code with VSCode.我有一个 lernajs mono repo 并使用 VSCode 编写代码。 Now I'm struggleing with the jsconfig.json file and the Jump to definition command.现在我正在努力处理jsconfig.json文件和Jump to definition命令。

When my jsconfig looks like this I can jump between my lerna packages but not into node_modules.当我的 jsconfig 看起来像这样时,我可以在我的 lerna 包之间跳转,但不能跳转到 node_modules。

{
  "compilerOptions": {
    "module": "es2015",
    "baseUrl": ".",
    "target": "es6",
    "jsx": "react",
    "paths": {
      "@my-org/package1": [
        "path/to/package"
      ],
      ...
    }
  }
}

When it looks like this I can jump into node_modules but not into my lerna packages.当它看起来像这样时,我可以跳到 node_modules 但不能跳到我的 lerna 包中。

{
  "compilerOptions": {
    "module": "es2015",
    "baseUrl": ".",
    "target": "es6",
    "jsx": "react",
    "paths": {
      "@my-org/package1": [
        "path/to/package"
      ],
      ...
    }
  },
  "include": [
    "node_modules",
    "**/node_modules/*"
  ]
}

So, how can I adjust the file that I can jump both into my lerna packages and node_modules?那么,如何调整我可以同时跳转到我的 lerna 包和 node_modules 的文件?

Have you tried both?你两个都试过吗?

 { "compilerOptions": { "module": "es2015", "baseUrl": ".", "target": "es6", "jsx": "react", "paths": { "@my-org/package1": [ "path/to/package" ], ... } }, "include": [ "node_modules", "**/node_modules/*" ] }

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM