browserify / resolve

Implements the node.js require.resolve() algorithm
MIT License
776 stars 184 forks source link

v1.17 preserves symlinks by default #226

Closed daniel-ac-martin closed 4 years ago

daniel-ac-martin commented 4 years ago

The v1.17 release (and indeed the 1.x branch) seems to default to preserving symlinks whereas the master branch does not.

Is this by design or is it a bug?

The root cause seems to be this line: https://github.com/browserify/resolve/blob/1.x/lib/sync.js#L42 It will only convert to a real path when the preserveSymlinks flag has been explicitly set to false.

Contrast that with this line (from master): https://github.com/browserify/resolve/blob/master/lib/sync.js#L42 It will always convert unless the preserveSymlinks flag has been given a truthy value.

daniel-ac-martin commented 4 years ago

Sorry, I've just spotted the extra comment on the README of the 1.x branch. It seems this is a bad default that you intend to fix in the next major release.

In that case, the problem I have is with the package calling resolve and not resolve itself.

Apologies for the inconvenience. I'll close this issue. Hopefully it will help someone else who come across this.

ljharb commented 4 years ago

You can npm install resolve@next if you want to try out the latest v2 prerelease, which has this default flipped.