-
-
Notifications
You must be signed in to change notification settings - Fork 35.7k
Require .\ does not work on Windows #6049
Copy link
Copy link
Closed
Labels
moduleIssues and PRs related to the module subsystem.Issues and PRs related to the module subsystem.windowsIssues and PRs related to the Windows platform.Issues and PRs related to the Windows platform.
Metadata
Metadata
Assignees
Labels
moduleIssues and PRs related to the module subsystem.Issues and PRs related to the module subsystem.windowsIssues and PRs related to the Windows platform.Issues and PRs related to the Windows platform.
Type
Fields
Give feedbackNo fields configured for issues without a type.
Windows uses backslashes inside paths and it seems to be supported by the
requirefunction. BUT ! When you use a backslash inside the "current path syntax" (usually./) it does not work. I found this using therequire.resolvemethod directly.Test case :
file /test/index.js :
file /test/stuff/please-require-me.js :
My test output :
As you can see in the second test, the backslash works, but in the third test it fails because it is in the "current path syntax".
Additional notes
I also made a quick check to see if the
.\is supposed to work, and it does :Specs