-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Does Flow support module path aliasing? #101
Comments
Tried to workaround this by creating a symlink in Flow's output has changed from but still does not work. Seems like a deal breaker for me too. |
@kompot can you test if it works with the hack of having your source tree folder called ie. /project
node_modules/ # 3rd party
src/
node_modules/ # your stuff
lib/ # your module
system/ # your module The hack here essentially allows you to reference |
@srcspider yep, it does work, thanks But the next fail is on |
@kompot that is indeed bad |
Thank you for reporting this issue and appreciate your patience. We've notified the core team for an update on this issue. We're looking for a response within the next 30 days or the issue may be closed. |
I think you can probably do this now via the |
I might be missing something, but I can't see how the |
any chance to solve it without a symlink hack? |
nevermind, I found this https://github.com/cdebotton/react-universal/blob/master/.flowconfig module.name_mapper='^common/(.*)$' -> '<PROJECT_ROOT>/../common/\1' I also add to add ../common in [include] because it's beyond my project. |
gre's solution worked for me as well, but I had to escape the parentheses:
|
From some of the presentations I've seen it seems flow has no issue with commonjs require syntax.
However, Is it possible to feed alias information into flow?
In grunt/gulp I prefer to go the extra mile and feed into the browserify/watchify/wathever task path alias information, so that instead of wriging
require('../../../../../../lib/merge')
and contextual variation thereof, I can just writerequire('lib/merge')
(orrequire('subprogram/lib/merge')
if the projects more complex) which is much easier to read, reason and grep/refactor. I also usually make directory names point todirectory/path/name/index.node
files (so I don't have to manually include every little piece of a component, ie. View, Model, etc).If flow can only work with dumb
require('../../../../lib/merge')
calls that's quite the deal breaker.The text was updated successfully, but these errors were encountered: