DEV Community

Discussion on: [Updated] Simplify the require/import paths in your project and avoid ../../../ circles of hell

Collapse
thedamon profile image
Damon Muma

Great writeup! There is also webpack alias settings, which you can use to achieve a similar thing. That is what we are using, although since our jest tests don't run webpack, we have to add the alias to jest as well. (we've made our root project directory '@'). I wonder if baking it into babelrc and using same babelrc files would cover the setup in one place.

Incidentally with the webpack.alias approach I haven't got autocomplete in VS Code working despite having followed the instructions to get it to work.. (though maybe not close enough)

Collapse
costicaaa profile image
costicaaa

We got it to work adding aliasFields... might wanna give it a shot.

Collapse
costicaaa profile image
costicaaa