chore: update build config

This commit is contained in:
Pooya Parsa
2025-01-22 11:40:00 +02:00
parent 35842c6ecd
commit 3f5a5dc6a4

View File

@@ -6,7 +6,12 @@ export default defineBuildConfig({
rollup: { rollup: {
inlineDependencies: true, inlineDependencies: true,
}, },
externals: ["@cloudflare/workers-types", "bun", "@deno/types", "uWebSockets.js"], externals: [
"@cloudflare/workers-types",
"bun",
"@deno/types",
"uWebSockets.js",
],
hooks: { hooks: {
async "build:done"(ctx) { async "build:done"(ctx) {
const entries = Object.keys(ctx.pkg.exports || {}) const entries = Object.keys(ctx.pkg.exports || {})
@@ -14,7 +19,6 @@ export default defineBuildConfig({
.map((key) => key.slice(2)); .map((key) => key.slice(2));
for (const entry of entries) { for (const entry of entries) {
const dst = join(ctx.options.rootDir, entry + ".d.ts"); const dst = join(ctx.options.rootDir, entry + ".d.ts");
console.log(">", dst);
await mkdir(dirname(dst), { recursive: true }); await mkdir(dirname(dst), { recursive: true });
const relativePath = const relativePath =
("..".repeat(entry.split("/").length - 1) || ".") + `/dist/${entry}`; ("..".repeat(entry.split("/").length - 1) || ".") + `/dist/${entry}`;