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:
+2
-2
@@ -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"
|
||||
|
||||
Vendored
+4
-4
@@ -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
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user