Skip to content

Commit

Permalink
fix: respect leading dot in import path
Browse files Browse the repository at this point in the history
  • Loading branch information
johannschopplich committed Aug 29, 2023
1 parent fcd8bc1 commit 46ccc08
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion scripts/post-build.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,10 @@ async function relativeTypePaths(filename) {
);

// Replace `pdfjs-dist/types` import path with relative path
content = content.replace(/pdfjs-dist\/types/g, `./${relativePath}`);
content = content.replace(
/pdfjs-dist\/types/g,
relativePath.startsWith(".") ? relativePath : `./${relativePath}`,
);

await writeFile(resolve(rootDir, filename), content, "utf8");
}

0 comments on commit 46ccc08

Please sign in to comment.