Skip to content

module: support custom paths to require.resolve()#16397

Merged
cjihrig merged 1 commit intonodejs:masterfrom
cjihrig:5963
Oct 25, 2017
Merged

module: support custom paths to require.resolve()#16397
cjihrig merged 1 commit intonodejs:masterfrom
cjihrig:5963

Conversation

@cjihrig
Copy link
Contributor

@cjihrig cjihrig commented Oct 23, 2017

I originally wrote this for #5963, but didn't open a PR. Today, it was requested again in #16389, so I thought I'd open a PR. I'm not sure how it will be received.

This PR supports passing custom paths to require.resolve(). The custom paths can replace the default paths, be prepended to the default paths, or be appended to the default paths. All of the functionality is isolated to a single if statement, so the impact on code that doesn't use this feature should be extremely minimal.

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • documentation is changed or added
  • commit message follows commit guidelines
Affected core subsystem(s)

module

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

Labels

module Issues and PRs related to the module subsystem. semver-minor PRs that contain new features and should be released in the next minor version.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

10 participants