mirror of
https://github.com/LukeHagar/crossws.git
synced 2025-12-06 04:19:26 +00:00
chore: update build config
This commit is contained in:
@@ -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}`;
|
||||||
|
|||||||
Reference in New Issue
Block a user