maxstue / vite-reactts-electron-starter

Starter using Vite2 + React + Typescript + Tailwind + Electron Starter.
MIT License
305 stars 91 forks source link

bundled files are not packaged #18

Closed gwendalF closed 2 years ago

gwendalF commented 2 years ago

Hello, I am having troubles distributing the electron app with your template. Even though the files include the out folder, the js files produced by vite are not included in the executable of the electron app. It uses my local files. If I delete these files, the application cannot load the js files. And if I use a CI/CD to build the app I cannot use the application. Any idea how to fix it? I found the electron-builder do difficult to understand. Thanks in advance for this template anyway. I found it very useful

maxstue commented 2 years ago

Hi, Sorry for my late response. So if you execute the ".exe" inside the dist folder it uses the dev files? Have you tried copying the dist folder to any other location and than try to execute it.

Because I can copy the dist folder anywhere, even another pc, and I can still run the app (the ".exe"-file)

gwendalF commented 2 years ago

Hello,

Yes it seems to use the out folder. I can move out to a different folder it will works but fails if I delete the out folder or use the app on another computer, without the out folder

Le dim. 27 févr. 2022 à 14:40, Maximilian Stümpfl @.***> a écrit :

Hi, Sorry for my late response. So if you execute the ".exe" inside the dist folder it uses the dev files? Have you tried copying the dist folder to any other location and than try to execute it.

Because I can copy the dist folder anywhere, even another pc, and I can still run the app (the ".exe"-file)

— Reply to this email directly, view it on GitHub https://github.com/maxstue/vite-reactts-electron-starter/issues/18#issuecomment-1053559361, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEJI6HJVYRKNXECAFIPZCKLU5ISU7ANCNFSM5NXWPJWQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you authored the thread.Message ID: @.***>

gwendalF commented 2 years ago

Hello,

Just an update on this issue. I've change the path on the index.html file produced in the out folder to be relative instead of absolute and it fixed this. I still have a missing path for the Electron icon asset since it uses my full path to the build icon and not I guess the relative one needed from the asar archive. I guess it's a vite configuration problem? EDIT: Changing the build base root to './' fix this. I now have correct path solution. I can make a pull request if needed

maxstue commented 2 years ago

Thanks for your info and help, this should be fixed now on the main branch :)