Closed papandreou closed 7 years ago
Thanks for the pull request @papandreou. The ability to pull the contents async from a promise sounds useful. If the promise took a long time to resolve, I think there could be a race condition where the webpack compilation starts before the resolve plugin has been attached to the compiler. But I think those resolve plugins might work via async so inside the resolverPlugin, it could detect if the contents are a promise and resolve it before populating the virtual filesystem and calling the plugin callback.
This pull also seems to be causing one of the tests to fail. I'll ping you when I've pushed something up that does what I outlined above and maybe you can test if it works with your experiment. Might be a little bit before I get to it though.
Oh, I didn't realize there was a test suite -- sorry! I fixed the bug and force pushed now :)
Sorry, apparently I attempted to push to the wrong remote repo, which failed without me noticing. Redid the fix and pushed now.
Played around with it a bit more, but I don't think it'll work. As far as I can tell, it's not enough to have the contents injected by the time the resolver plugin calls its callback. That's probably what you tried to point out in your initial feedback.
Let's close this PR until new insight comes up.
@papandreou Thanks for digging into it more. I'll let you know if I find a way it could work.
Just something I hacked up as part of another experiment -- contributing/sharing it here in case it might be useful.