-
-
Notifications
You must be signed in to change notification settings - Fork 191
Closed
Description
Suppose we are in /a/b/c/d.js
and require some-thing
and node_modules
is in /a/node_modules
, node-resolve
handles this extremely efficiently
Current behavior:
Checks these in order to see which one exists
/a/b/c/node_modules/some-thing.js
/a/b/c/node_modules/some-thing/node_modules/package.json
/a/b/node_modules/some-thing.js
/a/b/node_modules/some-thing/node_modules/package.json
/a/b/c/node_modules/some-thing.js
/a/b/c/node_modules/some-thing/node_modules/package.json
/a/node_modules/some-thing.js
/a/node_modules/some-thing/node_modules/package.json
It gets even more inefficient as the number of possible extension grows, it does some many stats that for our module bundler bundling our app it can easily get to a hundred thousand unnecessary stats
The ideal behavior would be
/a/b/c/node_modules
/a/b/node_modules
/a/node_modules
/a/node_modules/some-thing.js
/a/node_modules/some-thing/node_modules/package.json
I'm on [email protected] at the time of writing
Metadata
Metadata
Assignees
Labels
No labels