I started using TypeScript 2.6.2 for a VSTS extension project which has a UI control. Its HTML file used to have hard-coded paths for 3rd party references. Since some of them introduced a lot of internal logic and complexity, it was decided to create separate modules to aid the maintainability and testing of the code. The tests were created using mocha and chai. The module under test (X) itself requires a 3rd party library (Y) which type definition (@types/y) was installed and imported (import {sth} from y) successfully. Tests are running just fine, no issues there. However, the module X is required client-side too, referenced in the HTML once the VSS SDK reports ready state. When that happens, Y cannot be resolved. There is a Script error with requirejs docs hint link mentioned. No y.js file could be found.
The compiler options in the config are set to 'amd' for module and 'node' module resolution. I don't know how am I supposed to resolve this dependency chain all the way through.
So, what is the best way to address this so that it works in both testing and production scenarios?
Thank you!