Can I use a relative path to configure typescript sdk?

匿名 (未验证) 提交于 2019-12-03 01:23:02

问题:

Can I set up typescript.tsdk relative to my project dir/tsconfig file? It looks like this option works only with an absolute path.

回答1:

In your project's .vscode/settings.json:

{   "typescript.tsdk": "node_modules/typescript/lib" } 


回答2:

You can set in setting.json like this:

    "typescript.tsdk": "node_modules/typescript/bin" 

But this break ts files that no have typescript installed by npm in root folder. The best solution I have found, was:

    "typescript.tsdk": "/Users//AppData/Roaming/npm/node_modules/typescript/bin" 

Still work on ts projects without typescript installed localy.



易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!