简体   繁体   English

如何配置 VSCode 编译 Typescript 使用动态路径定位模块?

[英]How to configure VSCode to compile Typescript using dynamic paths to locate modules?

I have a complex, legacy JS project that I would like explore converting to TS.我有一个复杂的遗留 JS 项目,我想探索转换为 TS。 The first major hurdle is the fact that modules are resolved in a kind of quirky way: specifically I want tsc to look for them inside the project directory as normal, but if they aren't there, tsc should then look in the location of a ruby gem that is in use (I know, its odd).第一个主要障碍是模块以一种奇怪的方式解析:具体来说,我希望tsc像往常一样在项目目录中查找它们,但如果它们不存在,则tsc应该在ruby gem 正在使用中(我知道,它很奇怪)。 In other words, module paths need to be determined at run time.换句话说,模块路径需要在运行时确定。

Building the project has been solved.建设项目已解决。 What I need to do next is find some way to show VSCode how to find those modules.接下来我需要做的是找到一些方法来向 VSCode 展示如何找到这些模块。 Any specific ideas on how to go about this?关于如何 go 关于这个的任何具体想法? I've been exploring making a language service plugin but have not been able to find a clear way forward.我一直在探索制作语言服务插件,但一直没有找到明确的前进方向。

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

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