If you have been working on NodeJS projects for a while, I am pretty sure that you have ever seen “…/…/some/deep/import-path” syntax. I think these make you crazy with your code (or your partner 😅).

Can we refactor to make our codebase more prettier and clean? 🤔🧐

Absolutely YES!

We have many ways to do it but there may have risks and difficulties for each way. (You can try yourself with some references at the end).

The way I mention in this article is using the jsconfig.json file and babel-cli.

Image for post

Relative imports! Nightmare! 😅

#nodejs #node #javascript

Say “Goodbye” Relative Imports in NodeJS Projects
2.75 GEEK