I noticed that if you have a Typescript file that uses a reference path that is relative, the Typescript compiler will generate an output tree that is different from what typescript-require expects.
To reproduce, try creating two small modules in sibling subdirectories, src/foo.ts and test/bar.ts. Have test/bar.ts reference src/foo.ts using a relative reference path:
///<reference path="../src/foo.ts"/>
Importing test/bar.ts from a node script will fail because the resulting tmp directory created by tsc is not the same as what typescript-require internally expects it to be. See also my gist.
I noticed that if you have a Typescript file that uses a reference path that is relative, the Typescript compiler will generate an output tree that is different from what typescript-require expects.
To reproduce, try creating two small modules in sibling subdirectories,
src/foo.tsandtest/bar.ts. Havetest/bar.tsreferencesrc/foo.tsusing a relative reference path:///<reference path="../src/foo.ts"/>Importing
test/bar.tsfrom a node script will fail because the resulting tmp directory created bytscis not the same as what typescript-require internally expects it to be. See also my gist.