version: 20.4.1
I'm having trouble understanding some problems and restrictions that I ran into with files/extraFiles/extraResources configuration. I've read all possible documentations that I could find, and it still isn't clear to me. Please help me understand.
Assuming the following project structure:
โโโ app
โย ย โโโ index.html
โย ย โโโ index.js
โโโ electron
โย ย โโโ main.js
โย ย โโโ pack.js
โย ย โโโ package.json
โโโ package.json
/app is the application that I wish to release as a web application AND package as an electron app.
/electron is a packaging helper project that uses electron-builder; it is also the "app root" for electron-builder
/electron/pack.js is a node script that runs the electron-builder api.
Now the question is, how do I include files from /app into the electron app?
'../app/**/*' -- this is a valid relative path. However I don't think "relative" means what I think it means in this case. It seems like "relative" means that the file/directory must be contained within the electron project directory. Please correct me if I'm wrong.NOTE: I discovered the following while I was testing and writing up this issue:
Fileset.from, and it cannot be a glob patternThis works
files: [
{from: '../app/', to: '.'}
]
This doesn't work (Fileset + glob pattern)
files: [
{from: '../app/**/*', to: '.'}
]
This doesn't work (relative path without using Fileset)
files: [
'../app/'
]
I feel this is something that developers should be able to know by reading the documentation, but I had to figure it out through trial and error. Hope this will be useful to others who happen to across the same issue.
I've also found that when running with DEBUG=electron-builder, only the FileSet versions gives us a "file source doesn't exist" warning:

When using a String or Array String, no warning is visible. Here I ran the same code as above, but with
"build": {
"appId": "com.gingkoapp.desktop",
"extraResources": "xyznonsensepath",
...
And I don't get a warning:

Improving the docs would be important, but I think most people would be able to figure things out if we had warnings when a file isn't found, along with the path it tried.
Im trying to understand where eventually this extra resources being installed. I can package extraResources and see them in dmg file but i don't see this folder anywhere being created on destination machine
I'm pretty sure its being installed in the temp folder while being run
I would really like to see a warning when use String or Array String and files are missing also.
Is there a way to make electron-builder treat warnings as errors?
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Most helpful comment
I would really like to see a warning when use String or Array String and files are missing also.
Is there a way to make electron-builder treat warnings as errors?