Before, I worked on my React app with ES6 and used NODE_PATH='src'
to import files starting from the src
folder. However, since switching to Typescript, I've realized that NODE_PATH is not supported. After some investigation, I discovered that I could replace NODE_PATH with baseUrl
in the tsconfig.json
file. This solution has been working inconsistently for me.
Despite my efforts, I found conflicting information about whether this method is officially allowed in Typescript or if it's necessary to use relative paths instead. Is there a definitive answer on using NODE_PATH in Typescript, or are there other alternatives available?