Long story short:
I need to copy some files/directories over from my src folder to my dist/resources
folder. Is there any way I can 'automatically' copy these files/folders over during packaging? I am using Electron-packager
.
Long story:
I have a couple of folders containing JSON files that need to be read and copied over to a certain user directory. These are all done when I mount
a certain component.
I use readFileSync()
and using path.resolve
with __dirname
- but this generates an error since my relative path is different when I am running the packaged app (inside dist folder). Error is it cannot find my JSON file in dist/resources/config/settings.json
. Also tried to check content of my app.asar
but can't seem to find it there.
So my working workaround is to copy the directory/files over from my src folder to my dist/resources
folder.
But this is kind of hacky and prone to forgetting. Is there any way I can 'automatically' copy these files/folders over during packaging?