Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

configure NODE_PATH? #62

Open
brumm opened this issue Sep 11, 2018 · 1 comment
Open

configure NODE_PATH? #62

brumm opened this issue Sep 11, 2018 · 1 comment

Comments

@brumm
Copy link

brumm commented Sep 11, 2018

Hey,

we're using something similar to https://gist.github.com/branneman/8048520#52-only-while-executing-node to prevent having to use long, relative paths when importing/requiring modules.

Is there a way to make filing cabinet aware of such a situation? I'm trying to build a dependency graph for a project that uses NODE_PATH=src and would like to be able to resolve something like import Foo from 'components/Foo' to /absolute/path/to/project/src/components/Foo.js

@mrjoelkemp
Copy link
Collaborator

Hey! Thanks for contributing.

My initial hunch is that you might be able to add the env value of NODE_PATH to the list of require paths here:

appModulePath.addPath(moduleLookupDir);
.

You could try that by modifying that code deep within the consuming library (like dependency-tree or madge) and see if it works. If that doesn't work right away, the fix would definitely be in that region. Let me know what you find. I'm happy to review a PR that fixes the issue. Any help is appreciated.

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants