-
-
Notifications
You must be signed in to change notification settings - Fork 92
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
Webpack resolve support #17
Conversation
Yep! I use this feature too, but for other reasons:
I'm afraid this will require hand-supporting the Thanks for pointing me to: |
|
I began work on this tonight, but will require more effort & largely repeating how Webpack already works: More stuff to do:
|
More resources:
|
I have looked a bit into this and made a working prototype that manages things like:
The problem I have is that the current logic wants to check if the dependency is in the If you want @ericclemmons I can look more into this and create a separate PR for this or maybe you want to manage this yourself. |
@dlmr Sure, I'd like to see the PR! I'm trying to leverage as much of webpack's existing resolution logic as possible without re-implementing each option. |
An idea is to use https://www.npmjs.com/package/resolve instead of the normal I will look into this more and see if I can create a working PR that covers all the different cases. |
Regarding checking When this was a Webpack loader, I just did a |
The problem is that if we are checking I guess the logical thing to do here is to only match resolved dependencies against |
That sounds sane behavior to me. I guess you should try to install only if this resolution process fails in order to follow Webpack semantics. This might not be the correct thing to do always (maybe the user forgot to copy something?), but at least it's logical. |
I almost got this! The only problem I'm having is that, on the client-side builds, the dependencies install but the modules still aren't emitted in the bundle, unless you stop & restart the process: Here you can see the server installs dependencies & starts correctly...
But then, as the client build starts, the first level of dependencies are installed and then the build fails:
However, if you start the process all over again:
Everything works! So, it seems like by leveraging Webpack's internal |
@bebraw See the above message. I'm leveraging (I'm assuming there's some sort of race condition?) I just found out that |
@ericclemmons I think @sokra might be able to help you the best here. Let's hope we manage to summon him. 😉 |
In that case, bullet points for @sokra!
I'll probably get the tests passing again & tag this in v3, because this is a potentially breaking change in behavior. |
Yea, I like this enough that I'm gonna tag & release it anyway. I hope someone can help solve that weird nesting issue, but I can always just be like, "Uhhh...try saving again!" |
v3.0.0 is out! |
I have
resolve.alias
field in my webpack.It should install react-lite instead of react + react-dom.
Is this gonna be supported? xP