From 49747f502a6e99e76d08f0d0ab7fabaf87a06259 Mon Sep 17 00:00:00 2001 From: Prad Nukala Date: Wed, 7 Jan 2026 20:05:49 -0500 Subject: [PATCH] refactor(build): migrate build script to use bun build command directly --- package.json | 2 +- scripts/build.ts | 30 ------------------------------ 2 files changed, 1 insertion(+), 31 deletions(-) delete mode 100644 scripts/build.ts diff --git a/package.json b/package.json index b52d5b6..2a7aaa6 100644 --- a/package.json +++ b/package.json @@ -15,7 +15,7 @@ "dist" ], "scripts": { - "build": "bun run scripts/build.ts", + "build": "bun build ./src/index.ts --outdir ./dist --format esm --target browser --sourcemap=external --external @extism/extism --entry-naming enclave.js && bun run tsc --emitDeclarationOnly --declaration -p src/tsconfig.json --outDir dist", "typecheck": "tsc --noEmit -p src/tsconfig.json", "clean": "rm -rf dist" }, diff --git a/scripts/build.ts b/scripts/build.ts deleted file mode 100644 index 4916b58..0000000 --- a/scripts/build.ts +++ /dev/null @@ -1,30 +0,0 @@ -import { $ } from 'bun'; - -const result = await Bun.build({ - entrypoints: ['./src/index.ts'], - outdir: './dist', - format: 'esm', - target: 'browser', - minify: false, - sourcemap: 'external', - external: ['@extism/extism'], - naming: { - entry: 'enclave.js', - }, -}); - -if (!result.success) { - console.error('Build failed:'); - for (const log of result.logs) { - console.error(log); - } - process.exit(1); -} - -console.log('Build successful:'); -for (const output of result.outputs) { - console.log(` ${output.path}`); -} - -await $`bun run tsc --emitDeclarationOnly --declaration -p src/tsconfig.json --outDir dist`; -console.log('Type declarations generated');