Skip to content

Commit adb269c

Browse files
Zie619claude
andcommitted
fix: add type:module and exports field to resolve ESM/CJS CI failures
vitest 4.x requires ESM context to load its config. Without "type": "module", Node 18.x fails with ERR_REQUIRE_ESM when vitest/dist/config.cjs tries to require std-env (an ESM-only package). Adding "type": "module" makes vitest load the config as ESM and also aligns the dist output (now proper ESM exports) with the tsconfig NodeNext module mode. Added an exports field for correct package resolution by modern bundlers and Node.js. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent ae9e69e commit adb269c

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

package.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,15 @@
22
"name": "trusera-sdk",
33
"version": "0.1.0",
44
"description": "TypeScript SDK for monitoring AI agents with Trusera - intercept HTTP, evaluate policies",
5+
"type": "module",
56
"main": "dist/index.js",
67
"types": "dist/index.d.ts",
8+
"exports": {
9+
".": {
10+
"import": "./dist/index.js",
11+
"types": "./dist/index.d.ts"
12+
}
13+
},
714
"license": "Apache-2.0",
815
"repository": {
916
"type": "git",

0 commit comments

Comments
 (0)