-
-
Notifications
You must be signed in to change notification settings - Fork 33.2k
Closed
Labels
feature requestIssues that request new features to be added to Node.js.Issues that request new features to be added to Node.js.moduleIssues and PRs related to the module subsystem.Issues and PRs related to the module subsystem.

Description
A working prototype that enables using symlinks to machine level module stores, so modules no longer need to be physically copied and duplicated wherever they're used on a given machine. This is accomplished by:
- Effectively, setting
__dirname
of the "main" entry module to the preserved path passed on the command line, or if it's a file-symlink, using its target path. This is intended to start the program off in the right symbolic path space, to address tooling problems resulting from the current behavior, where__dirname
is always the fs.realpath(). - For all other
require()d
modules, always using the preserved path of its directory location as its__dirname
, but always using itsrealpath
as the module cache key. This resolves the memory bloat and add-on crashing problems while still letting resolution happen within the symbolic path space. - When building the list of search paths to be used for resolution, by interleaving adjacent
somemod+node_modules
directory paths after the subordinatesomemod/node_modules
, the directory structure dictating dependency version resolution can still be bound and specific to a given top-level/node_modules
, but can now be completely decoupled from the physical directories of the modules involved.
mathieumg, gramic, trueter, zkochan, svetikshark and 16 moresean-vieira, zkochan, iamstarkov, whmountains, jiku and 1 morenotpushkin, VanCoding, zkochan, gramic, trueter and 7 more
Metadata
Metadata
Assignees
Labels
feature requestIssues that request new features to be added to Node.js.Issues that request new features to be added to Node.js.moduleIssues and PRs related to the module subsystem.Issues and PRs related to the module subsystem.