Release with webpack and electron

The other day I started a project to deploy an electron app to an R Pi 3 b+. I was able to get everything working based off the resin-electron template with no issues (other than that I had to go to a 32 bit OS).

I saw there were Vue and React templates but I’ve set out to do this in Mithril, using webpack for bundling. I was able to get everything working on my local machine (both straight web and electron builds) but my device is not receiving the built distribution. If I run webpack on the device over CLI and reboot then then everything works.

Now I’ll confess I’m extremely new to this entire ecosystem, but I’m wondering if I have to explicitly run webpack somewhere in the docker template? The Vue and React templates didn’t seem to do anything like that and when I tried it wasn’t working properly. Perhaps there’s some other method for accomplishing this, or perhaps I’m deploying all wrong? I’ve got the workaround now but I’d love to put this issue to bed.

Hi AdamLee,

If you run webpack and commit the bundle files when pushing to balena then I think It will just work. Otherwise, you should run it during build time (in the Dockerfile or Docker template).

Hey there, in general, all preparation steps before running a containerized application, need to be present in the docker template. So including the steps that are needed (ie you currently need to run manually) would be the way to go here. Does it help?

Thanks for the responses you two. I did manage to get the build running from the docker template, I just didn’t try hard enough first because I wasn’t convinced that was the correct approach.

Just for completions sake, I added this line prior to the call to run

Build distributions

RUN JOBS=MAX npm run build

Thanks for following up!