Skip to content

Using assets with public folder #738

Answered by pmichel-J2S
pmichel-J2S asked this question in Q&A
Discussion options

You must be logged in to vote

Ok, so moved the assets I was refering to to /packages/renderer/public (since I didn't want them bundled/processed/renamed by Vite), thanks for the tip, I'm still a bit new to this 😅 (transitioning from electron-webpack where there was only one project).

My problem is, I would like to get the absolute path to the asset located in it. What I'm trying to do is call an external program and provide it with the full absolute path of the asset on the hard drive.

Basically, I just wrote this, but I'm not sure it's done the "right" way :

let thePath = path.join(appPath, 'packages/renderer/public/scripts/myscript.scr');

(in this example appPath points to app.getAppPath(), so the location where the…

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@cawa-93
Comment options

@pmichel-J2S
Comment options

Answer selected by pmichel-J2S
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants