-
-
Notifications
You must be signed in to change notification settings - Fork 185
add preserveSymlinks option #131
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Add the possibility to make `resolve` use real paths during resolution. Fixes browserify#130.
991944d
to
0fa967f
Compare
@ljharb could you please review this? although Travis is failing on some node versions, it doesn't seem to be caused by these changes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, this looks great - tests should be fixed on master; after a rebase we should be good to go!
lib/node-modules-paths.js
Outdated
@@ -11,6 +12,16 @@ module.exports = function nodeModulesPaths(start, opts) { | |||
// resolving against the process' current working directory | |||
var absoluteStart = path.resolve(start); | |||
|
|||
if (!opts || !opts.preserveSymlinks) { | |||
try { | |||
absoluteStart = fs.realpathSync(absoluteStart); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it is worth noting that this line means that this file will now not work in a browser; whereas i think it would have prior
}); | ||
|
||
test('sync symlink', function (t) { | ||
var start = new Date(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should be able to use Date.now()
here, nbd tho
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've just done the rebase for you; but perhaps we shouldn't make this be a breaking change by enabling the behavior by default?
Thanks!
I think |
Yeah - let's do that (have it default to true for now) and release a semver-minor. I'll plan a breaking change in the future that flips it to |
OK cool, I'll push the change in a few minutes |
771468e
to
3cd8620
Compare
Changed Added a notice to README about changing the default value of |
For context see: browserify/resolve#131 This fixes browserify for projects that use pnpm. Related issue at pnpm: pnpm/pnpm#795
Ref #130