electron / electron/forge

When is ESM support planned?

Open
#3,684 10 comments 10 reactions 0 assignees View on GitHub
esm
Dominant language
TypeScript
Stars
7.1k
Forks
641
Avg merge
3d 1h
Merged PRs (30d)
30

Description

### Pre-flight checklist

- [X] I have read the [contribution documentation](https://github.com/electron/forge/blob/main/CONTRIBUTING.md) for this project.
- [X] I agree to follow the [code of conduct](https://github.com/electron/electron/blob/main/CODE_OF_CONDUCT.md) that this project uses.
- [X] I have searched the issue tracker for a feature request that matches the one I want to file, without success.

### Problem description

When I wanted to migrate to ESM according to the latest version of electron-store, I found that forge.config.ts did not support ESM.
![CleanShot 2024-09-04 at 10 38 42](https://github.com/user-attachments/assets/ffbc18c4-20e7-4822-b3d4-efd338b151a2)

### Proposed solution

Support ESM in forge.config

### Alternatives considered

1. Wait for official support in future electron-forge versions.
2. Use a custom build process outside of electron-forge to support ESM.
3. Revert to CommonJS modules for the time being

### Additional information

ESM support is crucial for our project as we aim to use modern JavaScript features and improve code maintainability. The ability to use 'import' statements directly would significantly simplify our development process and allow us to better align with current JavaScript best practices. We've already migrated most of our codebase to use ESM syntax, and electron-forge's lack of support is the main blocker for our complete transition

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.