I need to implement some custom module-resolution logic for some TypeScript code that I have. I'm pretty new to TypeScript so the answer to this may be obvious. I've been looking at the Compiler API, specifically the section on customizing module resolution. I can see that I can provide an implementation for resolveModuleNames. What's not clear to me is how I can do that.
The only thing I'm trying to do is to implement this custom resolution logic, but use everything else as-is. Looking at the TypeScript compiler source, I see that it parses the commandline options and immediately spins up a compiler with CompilerHost that it creates. But it's not clear to me how I can hook into this or replace this CompilerHost instance.
Would I have to duplicate all this logic? The examples in the documentation seem to instantiate a compiler from scratch, and I can't find any examples where I can simply enhance the TypeScript compiler I am using.