Skip to content

Commit 6fb0e75

Browse files
authored
Fix duplicate output with multiple entry points (#251)
On Windows the normalized paths in resolveId end up in POSIX format. This cause rollup to treat the returned path as a new piece of content. This in turn results in duplicate output for references across entry points. Fixed by normalizing the path to use host OS separators before returning.
1 parent 5ce7676 commit 6fb0e75

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/index.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import { parseTsConfig } from "./parse-tsconfig";
1212
import { printDiagnostics } from "./print-diagnostics";
1313
import { TSLIB, TSLIB_VIRTUAL, tslibSource, tslibVersion } from "./tslib";
1414
import { blue, red, yellow, green } from "colors/safe";
15-
import { relative, dirname, resolve as pathResolve } from "path";
15+
import { relative, dirname, normalize as pathNormalize, resolve as pathResolve } from "path";
1616
import { normalize } from "./normalize";
1717
import { satisfies } from "semver";
1818
import findCacheDir from "find-cache-dir";
@@ -166,7 +166,7 @@ const typescript: PluginImpl<RPT2Options> = (options) =>
166166
context.debug(() => `${blue("resolving")} '${importee}' imported by '${importer}'`);
167167
context.debug(() => ` to '${resolved}'`);
168168

169-
return resolved;
169+
return pathNormalize(resolved);
170170
}
171171

172172
return;

0 commit comments

Comments
 (0)