Typescript best practices are changing fast in 1.x and I'm no longer sure what is a good way to achieve what I want:
- My sources are located at
src/
and useoutDir
to output tobuilt/
. - My tests are located at
test/
and I'm thinking of outputting those to eitherbuilt/
orbuilt/tests/
.
My test looks at test/**/*.ts
, src/**/*.ts
, typings/**/*.d.ts
. To get it to import my soruces properly, I would have to do:
import { SomeClass } from "../src/sourcefile";
Of course, running the output file in nodejs would now fail, since in the output, sourcefile.js
is located in the same (or parent) directory as my test.
Is there a good way to get separate TypeScript folders to think they're in the same directory as one another? Should I be using a --declaration
as an intermediate step? And if so, where to put it.