I have a directory structure like
- project
|- build
|- src
|- index.ts
|- file.txt
The typescript is compiled to the build directory and executed from there. I'm looking for a reliable way to access file.txt from the compiled module without having to account for the location of the build output.
For example, I could just assume that the file is at ../src/file.txt relative to the index.js in build but if the build output changes, that needs to be changed as well.
Is there possibly a way to pass root directory into an environment variable before the typescript is compiled?