Skip to content

Commit

Permalink
chore: update build config
Browse files Browse the repository at this point in the history
  • Loading branch information
pi0 committed Jan 22, 2025
1 parent 35842c6 commit 3f5a5dc
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions build.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,19 @@ export default defineBuildConfig({
rollup: {
inlineDependencies: true,
},
externals: ["@cloudflare/workers-types", "bun", "@deno/types", "uWebSockets.js"],
externals: [
"@cloudflare/workers-types",
"bun",
"@deno/types",
"uWebSockets.js",
],
hooks: {
async "build:done"(ctx) {
const entries = Object.keys(ctx.pkg.exports || {})
.filter((key) => key.startsWith("./"))
.map((key) => key.slice(2));
for (const entry of entries) {
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}`;
Expand Down

0 comments on commit 3f5a5dc

Please sign in to comment.