Skip to content

Commit 51ab07e

Browse files
pannagopmlanger
authored andcommitted
fix: make dist/index.js run as CommonJS while keeping source as ESM
The root package.json keeps "type": "module" so the source file (deployment-frequency-event.js) can use ESM import syntax for local development and testing. The dist/package.json is changed from {"type": "module"} to {"type": "commonjs"} so that dist/index.js (the ncc-bundled output referenced by action.yml) is treated as CommonJS by Node.js. This is required because GitHub Actions node20 runner loads the entry point via require(), which cannot load ES modules. The dist/index.js is rebuilt by ncc as pure CommonJS (IIFE-wrapped, uses require(), exports via module.exports).
1 parent 093e550 commit 51ab07e

2 files changed

Lines changed: 308 additions & 54 deletions

File tree

0 commit comments

Comments
 (0)