DEV Community

loading...

Discussion on: 😫 Tired Of Relative Imports? Time To Get Rid Of Them!

Collapse
adamcoster profile image
Adam Coster

This doesn't work for the JavaScript compiled by Typescript either, since the Typescript compiler doesn't rewrite import paths on compile. I ended up switching to Babel with the "Module Resolver" plugin for my Node projects (instead of using tsc) since being able to use path aliases is worth the annoyance of the extra dependency!

Collapse
christian102094 profile image
Christian Tapia

Spent several hours trying to configure it for Typescript. A real nightmare!

Thread Thread
valeriavg profile image
Valeria

Did you figure in the end? Otherwise try tsconfig-paths

Thread Thread
patarapolw profile image
Pacharapol Withayasakpunt

Can also be done with Babel, JavaScript also.

Some comments have been hidden by the post's author - find out more