In cases where two ASAR archives or app folders are created, we create a new index.js shim that points to the correct entrypoint depending on the host system's architecture.
This index.js shim was originally written in CommonJS, making it incompatible with Electron apps using ESM entrypoints, which are available starting in Electron 28.
This PR does a few things:
Adds an ESM version of the entry-asar/index.js shim.
Detects if the main entrypoint is ESM through type: module or main:*.mjs in package.json, then copies over the ESM or CJS shim accordingly.
Does a bit of tsconfig.json refactoring to support entry-asar having different compilation targets.
Fixes #90
In cases where two ASAR archives or app folders are created, we create a new
index.js
shim that points to the correct entrypoint depending on the host system's architecture.This
index.js
shim was originally written in CommonJS, making it incompatible with Electron apps using ESM entrypoints, which are available starting in Electron 28.This PR does a few things:
entry-asar/index.js
shim.type: module
ormain:*.mjs
in package.json, then copies over the ESM or CJS shim accordingly.tsconfig.json
refactoring to supportentry-asar
having different compilation targets.