Skip to content

Commit

Permalink
build: expose default export for compatibility types
Browse files Browse the repository at this point in the history
  • Loading branch information
pi0 committed Jan 29, 2024
1 parent ba40b53 commit 9934fb5
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions build.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,11 @@ export default defineBuildConfig({
const dst = join(ctx.options.rootDir, entry + ".d.ts");
console.log(">", dst);
await mkdir(dirname(dst), { recursive: true });

const relativePath =
("..".repeat(entry.split("/").length - 1) || ".") + `/dist/${entry}`;
await writeFile(
dst,
`export * from "${
"..".repeat(entry.split("/").length - 1) || "."
}/dist/${entry}";\n`,
`export * from "${relativePath}";\nexport { default } from "${relativePath}";\n`,
"utf8",
);
}
Expand Down

0 comments on commit 9934fb5

Please sign in to comment.