Normalize ids before looking up in named export map#406
Normalize ids before looking up in named export map#406lukastaegert merged 4 commits intorollup:masterfrom
Conversation
|
Ok, I need a better way to test this on Linux. I guess paths on linux must always be posix paths else things break. |
|
I'd recommend stealing the CI config from rollup/rollup. We made some pretty solid containers that it uses. |
Definitely, see my comment. |
|
@lukastaegert the latter approach seemed best actually. I've also updated the comments to be more clear, see if you like them now 😀 |
|
|
||
| // Note: customNamedExport's keys must be normalized file paths. | ||
| // resolve and nodeResolveSync both return normalized file paths | ||
| // so no additional normalization is necessary. |
There was a problem hiding this comment.
Yes, I'm cool with this, this is educational and will help people not familiar with the code 👍
|
Would this be a breaking change or a bug fix? |
|
@lukastaegert Sorry I missed your message. This should just be a bug fix that causes more things to work. It impacts e.g. rollup-plugin-typescript2, but only because the hack is no longer necessary (but doesn't do any harm). |
|
Actually I think it will break people who are currently using Should be a minor version at least. |
|
Thanks, then I'll make it a minor. |
This fixes an issue frequently hit when using the typescript rollup plugin. Because TypeScript always returns posix paths, but node resolve will normalize on a per-platform basis, comparisons must be carried out on normalized forms. This PR fixes some missing normalization and obviates rollup-plugin-typescript2's
rollupCommonJSResolveHackoption (/cc @ezolenko), and fixes #177 and probably a few others as well.