-
- Notifications
You must be signed in to change notification settings - Fork 33.7k
Closed
Labels
moduleIssues and PRs related to the module subsystem.Issues and PRs related to the module subsystem.
Description
- Version: v4+
- Platform: all
- Subsystem: module
At some time just before v4 a seemingly invalid test was introduced. It invalidates the resolve algorithm as documented by checking for ./foo/package.json before ./foo.js when using require('./foo') always.
The intent was for require("..") to prefer a directory instead of doing regular resolution. However, that does not match the documented algorithm which would require a / to invalidate file searching.
I don't have a clear way to explain the current behavior and would like to revert this behavior. We could state that matching /${path_separator}.?./$ at the end of a require specifier would automatically add / but that seems a bit odd.
I want to revert this change.
medikoo
Metadata
Metadata
Assignees
Labels
moduleIssues and PRs related to the module subsystem.Issues and PRs related to the module subsystem.