In Swatinem/rollup-plugin-dts#39, a windows user encountered the problem that a circular import back to the entry module was leading to duplicate definitions.
Essentially, rollup treated …/lawful/src/lawbook.ts and …\lawful\src\lawbook.ts as different modules.
I am not quite sure if it is my responsibility as plugin author to make sure the paths returned from resolveId are platform native (with \ separators on windows), or if rollup should just normalize the paths itself.
Expected Behavior / Situation
Rollup could normalize paths itself to platform-native separators. No matter if a plugin returns paths with / or \, it should not matter to rollup.
Actual Behavior / Situation
Rollup will just use the path returned from resolveId un-normalized, which can potentially lead to duplicate modules (one with / in its path, the other with \ on windows)
Modification Proposal
For my plugin, a simple path.resolve(pathWithForwardSlashes) solved my problems on windows by normalizing the path to use \ instead.
In Swatinem/rollup-plugin-dts#39, a windows user encountered the problem that a circular import back to the entry module was leading to duplicate definitions.
Essentially, rollup treated
…/lawful/src/lawbook.tsand…\lawful\src\lawbook.tsas different modules.I am not quite sure if it is my responsibility as plugin author to make sure the paths returned from
resolveIdare platform native (with\separators on windows), or if rollup should just normalize the paths itself.Expected Behavior / Situation
Rollup could normalize paths itself to platform-native separators. No matter if a plugin returns paths with
/or\, it should not matter to rollup.Actual Behavior / Situation
Rollup will just use the path returned from
resolveIdun-normalized, which can potentially lead to duplicate modules (one with/in its path, the other with\on windows)Modification Proposal
For my plugin, a simple
path.resolve(pathWithForwardSlashes)solved my problems on windows by normalizing the path to use\instead.