Galooshi / import-js

A tool to simplify importing JS modules

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Trouble working with webpack aliases

mattkime opened this issue · comments

I'm working with a project that has a number of webpack aliases defined. I'm unclear how to make importjs understand these aliases or even whether its possible. Relative imports seem to be working fine. If I manually translate a webpack alias into a relative path everything is resolved correctly. It seems like moduleNameFormatter should be able to help here but it doesn't appear to be executed - a console.log statement doesn't display anything. Perhaps its executed after a module path is resolved, not before.

Any advice on resolving webpack aliases?

I suggest looking into using the aliases configuration option:
https://github.com/Galooshi/import-js/blob/master/README.md#aliases

I need to ui/* => src/legacy/ui/public/* - is that possible with aliases? If so, it doesn't appear to be documented.

commented

need support webpack aliases +1