Skip to content

Commit c1a5c74

Browse files
Niki2k1claude
andauthored
fix: add tsup --shims for ESM/CJS dirname compatibility (#308)
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) <noreply@anthropic.com>
1 parent c52e50e commit c1a5c74

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

packages/sync-engine/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"scripts": {
1919
"clean": "rimraf dist",
2020
"prebuild": "npm run clean",
21-
"build": "tsup src/index.ts --format esm,cjs --dts && cp -r src/database/migrations dist/migrations",
21+
"build": "tsup src/index.ts --format esm,cjs --dts --shims && cp -r src/database/migrations dist/migrations",
2222
"lint": "eslint src --ext .ts"
2323
},
2424
"files": [

0 commit comments

Comments
 (0)