¿Cómo incluir un archivo .js en una página html con webpack y electron-forge ?
página 'html`:
<html> <head> <meta charset="UTF-8"> </head> <body> <div id="app"></div> <div class='viewer' id='viewer' title="MainPage" width= "480" height="480"> <script> const global = globalThis; </script> <script src="./file-to-import.js"></script> <script> </script> <style> </style> </body> </html> He agregado un entry point en package.json :
"entryPoints": [ { "html": "./src/app/index.html", "js": "./src/app/renderer.ts", "preload": { "js": "./src/main/preload/preload.ts" }, "name": "main_window" }, { "html": "./src/app/index.html", "js": "./src/app/file-to-import.js", "preload": { "js": "./src/main/preload/preload.ts" }, "name": "main_window" }, Y también agregué una ruta de copia a webpack.plugins.js :
new CopyPlugin({ patterns: [ { from: path.resolve(__dirname, "./src/app/file-to-import.js"), to: path.resolve(__dirname, ".webpack/renderer/main_window/file-to-import.js") } ] })En .webpack/renderer/main_window, el archivo file-to-import.js está presente:
(base) raphy@pc:~/Playground/.webpack/renderer/main_window$ ls -lah total 716K drwxrwxr-x 2 raphy raphy 4.0K Jun 13 13:44 . drwxrwxr-x 4 raphy raphy 4.0K Jun 13 13:44 .. -rw-rw-r-- 1 raphy raphy 60 Jun 13 13:44 file-to-import.js -rw-rw-r-- 1 raphy raphy 409 Jun 13 13:44 index.html -rw-rw-r-- 1 raphy raphy 554K Jun 13 13:44 index.js -rw-rw-r-- 1 raphy raphy 141K Jun 13 13:44 preload.js pero sigo sin poder cargar el recurso: 
¿Qué estoy haciendo mal? ¿Cómo cargar correctamente el archivo en la página html?