Switch build output to CommonJS (.cjs) format

Updated build script to output .cjs files instead of .js, and updated action.yml to reference the new .cjs files. Also clarified proxy environment variable handling in bootstrap.js for consistency.
This commit is contained in:
Parker Brown
2025-08-22 13:22:02 -07:00
parent 21c1159e4d
commit 00ba6edc66
3 changed files with 7 additions and 7 deletions
+2 -2
View File
@@ -133,5 +133,5 @@ outputs:
description: "GitHub App slug"
runs:
using: "node24"
main: "dist/bootstrap.js"
post: "dist/post.js"
main: "dist/bootstrap.cjs"
post: "dist/post.cjs"
+4 -4
View File
@@ -1,7 +1,7 @@
// Enable env-based proxy support before loading the main bundle (unless caller explicitly set NODE_USE_ENV_PROXY)
// Enable env-based proxy support unless caller explicitly set NODE_USE_ENV_PROXY
if (process.env.NODE_USE_ENV_PROXY == null) {
process.env.NODE_USE_ENV_PROXY = "1";
process.env.NODE_USE_ENV_PROXY = 1;
}
// Defer to original main entry (dynamic import ensures above code runs first)
await import("./main.js");
// Import main after environment prepared. Using dynamic import so this executes first even when bundled.
import("./main.js");
+1 -1
View File
@@ -8,7 +8,7 @@
"node": ">=24.4.0"
},
"scripts": {
"build": "esbuild bootstrap.js main.js post.js --bundle --outdir=dist --format=esm --platform=node --packages=bundle",
"build": "esbuild bootstrap.js main.js post.js --bundle --outdir=dist --out-extension:.js=.cjs --platform=node --packages=bundle",
"test": "c8 --100 ava tests/index.js",
"coverage": "c8 report --reporter html",
"postcoverage": "open-cli coverage/index.html"