-
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
Custom loader integration #293
Comments
The issue is also described well in #2939 by @JohnLouderback. import './myFile'
// => apps/[currentProjectName]/assets/javascripts/myFile
// => apps/common/assets/javascripts/myFile (if the former file does not exist) This is currently accomplished by a custom Babel plugin. AFAIK, this isn't currently possible to do with Flow. What would be the best way to accomplish such behavior? I don't think we can allow babel to process files before Flow because then we'd need source maps and it would really complicate things overall. But clearly, we need to do some kind of processing that includes checking if a file exists (accounting for many possible extensions). I'm willing to submit a PR, but first, we need to decide what we want to do (if anything). |
@goodmind should it be closed? |
I don't think it should, Flow team planned to remove custom loaders |
This is needed to be able to still use Flow with Yarn 2. |
@goodmind where's that thread? |
Is there any (at this point I would accept any ugly, hack-ish solution) way of achieving this using the latest version of Flow? |
I don't think we are likely to allow this in the future. Module resolution gets more complicated than a simple function call, when you also need to worry about updating the dependency graph incrementally. |
Is it currently possible to specify a custom resolve hook? It would be really useful with this to be able to integrate a custom loader like SystemJS into Flow, which has its own resolution rules.
Basically, allowing a loader resolution hook to be provided as input. Generally the resolve hook takes the following form:
In the loader I believe it may also allow a promise to be returned for asynchronous resolution.
Does such a thing exist? Does it sound sensible?
The text was updated successfully, but these errors were encountered: