I've encountered a challenge while working on my Electron project and using Electron-packager to package the app.
The issue lies in the folder structure, where CSS files located in the parent folder of the Electron project/package.json are not getting copied to the packaged application.
This is how my structure looks like:
- GUI
--- CSS
- Apps
---Demo
------package.json, etc
---Demo2
------package.json, etc
---Demo3
------package.json, etc
I develop apps within the 'Demo' folder. However, moving the 'GUI' folder inside 'Demo/Demo2/Demo3' would be redundant as it contains the exact same files.
Unfortunately, electron-packager
does not support packaging files from outside the 'Demox' folder directly.
Suggestions have been made to relocate these CSS files to the node_modules
directory instead.
The dilemma now is how do I properly require
these CSS files from the node_modules folder into an HTML file without resorting to using webpack
? I prefer to keep it simple and avoid setting up webpack unless absolutely necessary.
If you're interested, here's the question I posted on Electron-packager GitHub for more context: https://github.com/electron/electron-packager/issues/1089
Thank you!