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

API - Resolver documentation confusing #1505

Closed
43081j opened this issue Aug 10, 2017 · 3 comments
Closed

API - Resolver documentation confusing #1505

43081j opened this issue Aug 10, 2017 · 3 comments
Assignees

Comments

@43081j
Copy link

43081j commented Aug 10, 2017

Regarding this page.

I noticed webpack allows plugins in the resolve config (resolve.plugins). So I assumed these kind of plugins are defined as per the documentation found here.

However, this page gives absolutely no information at all about creating a "resolver" or how to go about implementing one. It mentions what methods a resolver has access to and should use, but not how to create one.

It would be of great use if there was at least a linked example, or the boilerplate of such a plugin.

Edit: Removed second issue, as it was a scoping problem on my end.

@43081j
Copy link
Author

43081j commented Aug 10, 2017

Another example is that the same page specifies resolve takes (string, string). But in actual fact it seems to receive (object, function).

Presumably the second parameter is a callback and the first is some sort of object representing what the docs think are in it?

@skipjack
Copy link
Collaborator

skipjack commented Nov 19, 2017

This seems pretty related to #1458 and @mlcohen's description of resolvers and the enhanced-resolve package. @mlcohen I've dug into this a bit more the over the last day or two and here's what I think we should do:

  • Submit a PR to the enhanced-resolve package's README with some of your write up.
  • Add another section called "Utilities", similar to loaders and plugins, and dynamically pull in all utility README's as page (similar to what we do for plugins and loaders).
  • Break the Resolver page out of the "API > Plugins" section to a single page or group (i.e. API > Resolvers > [multiple pages] or simply API > Resolvers (single page).

What do you all think about this approach? @43081j in the meantime I would recommend reading @mlcohen's detailed comment and checking out the enhanced-resolve package as that's really what's used to create resolvers.

@skipjack
Copy link
Collaborator

skipjack commented Feb 7, 2018

Created an issue over at webpack/enhanced-resolve#133 and rewrote the resolvers page on the next branch in #1754 to make things a little more clear and offset much of the actual documentation to the package's README to avoid duplication.

We can look into creating that Utilities section later on.

@skipjack skipjack closed this as completed Feb 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants