Skip to content

Add support for ESM #180

@jarrodek

Description

@jarrodek

I upgraded my project to work as ESM. I use the esm module when running the main script, all my renderer classes are going through a custom protocol that load modules as defined in the ES spec. I am almost ready to release the app but apparently I can't perform tests because everything is crashes. So, similarly to mocha I tried to use --require esm which fixes the problem (electron-mocha uses --require-main or --require). This, however, didn't work. Then I tried a different approach which creates a a common export file just for test, where the main file is a regular Common JS file, but it employs esm module to load a ES file that has exports for the classes. this doesn't work as well. After that I don't really have more ideas how to proceed. Maybe you guys has a similar issue and can help here?

To visualize what I am trying to do.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions