enhanced-resolve icon indicating copy to clipboard operation
enhanced-resolve copied to clipboard

fix: corrects resolve for win32 paths

Open davakh opened this issue 1 year ago • 1 comments

fixes https://github.com/webpack/enhanced-resolve/issues/401

accidentaly closed previous PR: https://github.com/webpack/enhanced-resolve/pull/402

davakh avatar Oct 30 '24 20:10 davakh

Why just don't coonvert it to unix path and work internaly only with /? I just don't understand some of the changes.

That's what I did, that's how it works right now in this PR: we convert the external paths, we can get it in resolver or with ResolverFactory options and work internally only with posix / path separator.

So, actually, we convert win32 path to posix path only in case of ResolverFactory options or resolver usage. Yes, there can be some exceptions: f.e. PnpPlugin - it gets new paths from the pnpapi so it requires to handle this case separately.

UPDATE: Okay, I think that I got where the misunderstanding comes from: I'm thinking more about using win32 paths still but with posix path separator - because node.js supports this. So for me, it means we work with relative type of path (win32/posix) based on OS, but we have posix separator in win32 paths instead of win32 separator and it's still win32 type path.

davakh avatar Nov 01 '24 21:11 davakh