-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feature Request] Allow custom publisher with .cjs Extension #8862
Comments
Great request, I think we have already-existing logic that we can leverage here to make this feature request come true. I'll take a look at this when I find some free time. Just quick note, I do have some high-prio bugs to get to first though. |
@davbrito would you be willing to try this
|
Description
I would like to request support for using the .cjs extension for build/electron-publisher-custom.cjs files. This would help in scenarios where you have
"type": "module"
in yourpackage.json
. Additionally, it would be beneficial to support ES modules for the custom publisher file.Current Behavior
Currently, it only accepts
.js
files with CommonJS. So, it ignores the.cjs
file. But, if I use.js
it would fail to load. Because I have"type": "module"
in the package.json.Proposed Behavior
.cjs
extension for custom publisher scripts, allowing files namedbuild/electron-publisher-custom.cjs
to be used.Use Case
This feature is particularly useful for projects that use
"type": "module"
and need custom publisher scripts in the Electron build process. Supporting ES modules would further increase flexibility and adherence to modern JavaScript standards.Key Line Reference
The relevant key line is located here.
electron-builder/packages/app-builder-lib/src/publish/PublishManager.ts
Lines 352 to 356 in f4fc04a
Benefits
Increased flexibility in the types of modules that can be used for custom publishers.
Better alignment with Node.js module standards.
Support for modern ES modules, enhancing compatibility and future-proofing.
The text was updated successfully, but these errors were encountered: