Absolute imports in phoenix project

Hey all,

Have anybody ever gotten absolute imports working with brunch?

I’ve tried using babel-module-resolver but always get some weird errors in my browser.

It’s a huge pain always writing…

import {function} '../../../../module'

when you really want to just write
import '/module'

Hi,

If you are willing to move to webpack, you may get some benefits also pheonix 1.4 uses the same hooks as this articles describes.

Also even if it was a lot of work for him to make it work he created a step by step guide. So it shouldn’t be to difficult to follow it.

Good luck

Aye, I ended up going this route.

Ended up working out great - I’ve been wanting to move to webpack anyways!

Thanks!

1 Like

You are welcome