DEV Community

Raphaël Badia
Raphaël Badia

Posted on

2 1

How to change electron forge's renderer port

I just started using electron-forge and I stumbled across a problem : when trying to change the renderer's port (that runs by default on port 3000), my changes to the webpack file were ignored...

I found out on their github that they override the webpack config in their custom webpack (@electron-forge/plugin-webpack) package. But they still gave us two options (port and loggerPort) to achieve our needs and you can write them in the package.json like so :

{
    "config": {
        "forge": {
             "plugins": {
                 [
                      "@electron-forge/plugin-webpack",
                      {
                           "port": 3001, // default is 3000
                           "loggerPort": 9001,  // default is 9000
                      }
                  ]
             }
        }
    }
}
Enter fullscreen mode Exit fullscreen mode

A bit too nested and undocumented if you want my opinion.

Sentry image

Hands-on debugging session: instrument, monitor, and fix

Join Lazar for a hands-on session where you’ll build it, break it, debug it, and fix it. You’ll set up Sentry, track errors, use Session Replay and Tracing, and leverage some good ol’ AI to find and fix issues fast.

RSVP here →

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay