My application has some json files in the source directory. My application reads these files through their relative paths. For example, I load a file like this;
var rawdata = fs.readFileSync('myData.json');
This normally works perfectly because the json file is in the same directory as the the application. When I package the application using Electron packager, all the files in my source directory are moved into the /resources/app folder. But the application itself runs from the root directory so all relative references are broken.
What is the method I should use to work around these changing paths?