From f731d7dd7ea204bbc79a9154854dbb0267faf6cf Mon Sep 17 00:00:00 2001 From: Niklas Lausch Date: Sat, 4 Apr 2026 22:22:51 +0200 Subject: [PATCH] fix: add tsup --shims for ESM/CJS dirname compatibility Bare __dirname is a CJS-only global and is undefined in ESM contexts. Enable tsup --shims so both the ESM and CJS builds get proper polyfills for __dirname, __filename, and import.meta.url respectively. Co-Authored-By: Claude Opus 4.6 (1M context) --- packages/sync-engine/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/sync-engine/package.json b/packages/sync-engine/package.json index 15982792e..51d90d670 100644 --- a/packages/sync-engine/package.json +++ b/packages/sync-engine/package.json @@ -18,7 +18,7 @@ "scripts": { "clean": "rimraf dist", "prebuild": "npm run clean", - "build": "tsup src/index.ts --format esm,cjs --dts && cp -r src/database/migrations dist/migrations", + "build": "tsup src/index.ts --format esm,cjs --dts --shims && cp -r src/database/migrations dist/migrations", "lint": "eslint src --ext .ts" }, "files": [