Fix logical→physical path conversion for absolute paths

This commit is contained in:
D. Berge
2025-06-26 23:57:19 +02:00
parent e6669026fa
commit 9ef551db76

View File

@@ -22,7 +22,7 @@ function translatePath (file) {
if (typeof importPaths === "string") {
// Substitute the root for the real physical path
// NOTE: `root` deals with import_paths not being absolute
const prefix = Path.resolve(Path.join(root, importPaths));
const prefix = Path.resolve(root, importPaths);
const suffix = Path.resolve(file).replace(/^\/+/, "");
const physicalPath = Path.resolve(Path.join(prefix, suffix));
return validate(physicalPath, prefix);