Skip to content

Commit 9b73758

Browse files
dayongkrclaude
andcommitted
fix(types): add root types.d.ts shim for node10 module resolution
attw fails under node10 resolution because it ignores the "exports" map and the types module has no root shim. Create a declaration-only root shim (types.d.ts without a runtime types.js) in postbuild, matching how the other modules are exposed to node10 consumers. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 321d5ac commit 9b73758

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

.scripts/postbuild.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,10 @@ if [ -d dist/types ]; then
4949
find dist/types -type f \( -name '*.js' -o -name '*.mjs' -o -name '*.cjs' \) -delete
5050
fi
5151

52+
# node10 moduleResolution ignores "exports", so it needs a root shim like the other
53+
# modules. Declaration-only, so only the .d.ts is created (no types.js counterpart).
54+
echo "export * from './dist/types';" > types.d.ts
55+
5256
# Create compat directory
5357
mkdir -p compat
5458

0 commit comments

Comments
 (0)