electron-forge entry point obscures html files

41 views Asked by At

I have an electron app, which is configured with the help of electron-forge. When I define an entryPoint like so:

      "plugins": [
        [
          "@electron-forge/plugin-webpack",
          {
            "mainConfig": "./webpack.main.config.js",
            "renderer": {
              "config": "./webpack.renderer.config.js",
              "entryPoints": [
                {
                  "name": "documents",
                  "html": "./src/renderer/windows/documents/documents.html",
                  "js": "./src/renderer/windows/documents/renderer.js",
                  "preload": {
                    "js": "./src/renderer/windows/documents/preload.js"
                  }
                }
              ]
            }
          }
        ]
      ]

...if I have other html files under /src/renderer/windows/documents, I can't seem to be able to access them. Let's say that the contents of /src/renderer/windows/documents are:

documents.html
another_html_file.html
renderer.js
preload.js

The entryPoint defines a URL that looks like this: http://localhost:3000/documents, and if I try to access another_html_file.html, for example using an anchor link to http://localhost:3000/documents/another_html_file.html, I get the following error:

Cannot GET /documents/another_html_file.html

Only the url http://localhost:3000/documents/ actually results in the loading of a file (documents.html).

What do I need to do to have free access to html files under the entryPoint location?

0

There are 0 answers