Skip to content

Commit af98f97

Browse files
fix: Use dynamic import in check script for ESM package
The npm package is "type": "module", so the existing CommonJS require() in the check script throws ERR_REQUIRE_ESM on Node 20+. Switch to import() — works in both CJS and ESM contexts without --input-type. Caught by Codex review on #8.
1 parent c769ef2 commit af98f97

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

npm/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"antlr": "mvn exec:exec",
1818
"build": "npm run clean && npm run antlr && tsc",
1919
"build:test": "npm run build && npm test",
20-
"check": "node -e 'require(\"./dist/src/index.js\").check()'",
20+
"check": "node -e 'import(\"./dist/src/index.js\").then(m => m.check())'",
2121
"clean": "rm -rf dist",
2222
"init": "npm ci && npm run antlr",
2323
"lint": "eslint --cache --cache-location .eslintcache ./src --fix",

0 commit comments

Comments
 (0)