Skip to content

Commit

Permalink
Make it so Electron Forge actually uses forge.config.js
Browse files Browse the repository at this point in the history
Removing `config.forge` from `package.json` made it give an error:

    An unhandled rejection has occurred inside Forge:
    Error: packageJSON.main must be set to a valid entry point for your Electron app

The error did not say what `package.json` file it was looking it, but
the issue was that it was finding the wrong `package.json` due to
guessing logic in `resolve-dir.ts` that only looked for the
`config.forge` keys in `package.json` when determining what
`package.json` to use, ignoring `forge.config.js`, and defaulting to
the outermost `package.json`, not the innermost one.

Update Electron Forge to v6.0.0-beta.71 which includes a change
which remedies the problem: electron/forge#3023
Now Electron Forge checks also for a dependency on `@electron-forge/cli`
and so finds the correct `package.json` again.

Now Electron Forge can actually use `forge.config.js`, and this fixes
the executable name, the icons in some cases, and other metadata,
as well as the `@electron-forge/publisher-github` plugin, presumably.
  • Loading branch information
1j01 committed Apr 19, 2024
1 parent 0295031 commit affcc10
Show file tree
Hide file tree
Showing 2 changed files with 1,771 additions and 1,693 deletions.
Loading

0 comments on commit affcc10

Please sign in to comment.