70bf21e064
Deploy (to testing) and Test Playground Preview Worker / Deploy Playground Preview Worker (testing) (push) Has been skipped
Deploy Workers Shared Staging / Deploy Workers Shared Staging (push) Failing after 0s
Prerelease / build (push) Has been skipped
Handle Changesets / Handle Changesets (push) Has been cancelled
Semgrep OSS scan / semgrep-oss (push) Has been cancelled
44 lines
1.1 KiB
TypeScript
44 lines
1.1 KiB
TypeScript
import { defineConfig } from "tsup";
|
|
|
|
export default defineConfig(() => [
|
|
{
|
|
treeshake: true,
|
|
keepNames: true,
|
|
// Two entry points share context.ts as a singleton. esbuild's default
|
|
// `splitting: true` dedupes it into a shared chunk. If splitting is
|
|
// disabled, each entry bundles its own copy and init (via one entry)
|
|
// won't populate globals read via the other. Keep splitting enabled.
|
|
entry: {
|
|
index: "src/index.ts",
|
|
context: "src/shared/context.ts",
|
|
},
|
|
platform: "node",
|
|
format: "esm",
|
|
dts: true,
|
|
outDir: "dist",
|
|
tsconfig: "tsconfig.json",
|
|
metafile: true,
|
|
sourcemap: process.env.SOURCEMAPS !== "false",
|
|
noExternal: [
|
|
"@cloudflare/config",
|
|
"@cloudflare/containers-shared",
|
|
/^@cloudflare\/workers-shared(\/.*)?$/,
|
|
],
|
|
external: [
|
|
/^@cloudflare\//,
|
|
"blake3-wasm",
|
|
"miniflare",
|
|
"p-queue",
|
|
"pretty-bytes",
|
|
"undici",
|
|
"chalk",
|
|
"dotenv",
|
|
"command-exists",
|
|
"esbuild",
|
|
// Keep zod external so wrangler (the only consumer) bundles a single
|
|
// shared copy rather than inlining one here.
|
|
/^zod(\/.*)?$/,
|
|
],
|
|
},
|
|
]);
|