fix: tentative fix for absolute paths on windows
Given that upstream doesn't want to address this directly (https://github.com/wooorm/import-meta-resolve/issues/31) and downstream is now blocked on this (https://github.com/storybookjs/storybook/issues/32364) here's a tentative workaround for
- fixes #297
let's wait for @pi0 but i wonder if we should be fixing this at the source instead of the call site
https://github.com/unjs/mlly/blob/e9faaf89dae61d3c8baf1ee585cdf5781b116805/src/utils.ts#L14-L19
i feel like maybe this logic should be switcheroo'd?
export function fileURLToPath(id: string | URL): string {
const idString = typeof id === 'string' ? id : id.href;
if (id.startsWith("file://")) {
return normalizeSlash(_fileURLToPath(id)); // pass the original `URL | string` since the built in fileURLToPath accepts both
}
return normalizeSlash(idString);
}
Thanks for the PR. I haven't read it through but unlikely we make risky changes in mlly resolve utils anymore as should be deprecated.
I suggest migrating to exsolve and report any windows related issues (i think should be less/no issues with exsolve)
I've raised a PR to migrate to exsolve; however, at this late stage in the release cycle they may be unwilling to switch implementations.
Added two comments on https://github.com/storybookjs/storybook/pull/32383