We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 87f756b commit a1c6190Copy full SHA for a1c6190
1 file changed
src/lib/generateBundle.ts
@@ -1,7 +1,7 @@
1
import { generateDtsBundle } from "dts-bundle-generator";
2
import { randomBytes } from "node:crypto";
3
import { rmSync, writeFileSync } from "node:fs";
4
-import { sep as pathSeparator, resolve } from "node:path";
+import { dirname, sep as pathSeparator, resolve } from "node:path";
5
import ts from "typescript";
6
7
function getHighestCommonDirectory(paths: string[]): string {
@@ -16,7 +16,7 @@ function getHighestCommonDirectory(paths: string[]): string {
16
}
17
18
if (otherPaths.length === 0) {
19
- return firstPath.replace(/[\\/][^\\/]+$/, "");
+ return dirname(firstPath);
20
21
22
const [firstParts, ...otherPathParts] = paths.map((p) =>
0 commit comments