I'm wanting to read in JSON files from local disk at runtime after electron-bulder packages up the Windows executable. These files already exist as part of the build itself, and I have set the following to have the JSON files places in a directory that I assumed should be relative to both the development release versions.
"extraFiles": [{
"from": "./src/json/",
"to": "json",
"filter": [
"**/*"
]
}],
When I open my release folder, and check the unpacked files, I see a json
folder with my files. I'm currently importing the JSON files in my .ts
files using the import * as alias from '@json/jsonFile.json
where @json
is a defined path in my 'paths'
section of tsconfig.json
. If I change the JSON file after the release is built and then run the electron application the changes are not being picked up.
Is this because the JSON files get packaged during the electron-build process so that the files I'm dumping out to the json
folder are effectively useless? I really would like to be able to give user control over how they update the output JSON files so that there is a level of dynamic control over the data the application processes.
Any help would be extremely appreciated.
Thanks!