Open sigdestad opened 3 years ago
It is said on the page you linked
If the path is relative then it will start looking for the file from the local directory
It also says
The function implements parts of the
CommonJS Modules Specification
And one who is familiar with it can know that
Relative identifiers are resolved relative to the identifier of the module in which "require" is written and called.
So, it is explained at least twice how relative paths are resolved.
BTW, there is no lookup in anywhere else (/lib etc...) as it would be against CommonJS Modules Specification
AFAIK this has a resolution pattern of some kind (locally first, then within /lib etc..) https://developer.enonic.com/docs/xp/stable/framework/globals#require