DEV Community

Raphaël Badia
Raphaël Badia

Posted on

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.

Top comments (0)