electron / website

:electron: The Electron website
https://electronjs.org
Apache License 2.0
112 stars 126 forks source link

add info about how to handle filepaths in electron #410

Open Taschenbuch opened 1 year ago

Taschenbuch commented 1 year ago

From my own experience in my team at work and from the discord here that is one of the biggest issues for people setting up electron for the first time and even later it can cause confusion. Especially the part that it may work in development mode (electron .) but not after being packed and run via .exe, can be very confusing and can cost hours/days to fix when you are new to that.

should be covered:

Bricobit commented 2 months ago

I'm trying electron for the first time and I'm going crazy with the paths, anything that is loaded even if you put a specific path, it puts the absolute path of the site where the file that does the loading is located in front of it, I want to keep my application agnostic because it uses libraries that import resources and that are dependencies of other projects that may or may not be running on a web server or in a local folder under electron, and because of the paths it breaks everything and I don't want to create two versions of my libraries, one for the web and another for electron because of the paths, it's a pain.