Skip to content

Node's require.resolve options #150

Closed

Description

@reggi

I see there's a lot of discussion about what the defaults should be for this module. It seems like it's too late for that. This module is already in use. However I'm using this in a project and expected .json to work as well as package.json main, and it's not. I would appreciate if someone could share what options that should be passed to mimic the node's default, perhaps we can add another function to this module in the future or just add it to the docs to help mitigate confusion.

How do I get it to check for package.json main?

Starting the config here:

{
  "extensions": [ ".js", ".json", ".node"]
}

Activity

  1. ljharb commented on Feb 18, 2018

    @ljharb
    Member

    That indeed should do it, since those are the default extensions; you can also do "extensions": require.extentions

  2. reggi commented on Feb 22, 2018

    @reggi
    Author

    Ah, ok the issue i'm having is related to Promises.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions