# Release with webpack and electron

**URL:** <https://forums.balena.io/t/release-with-webpack-and-electron/17226>\
**Category:** Product support\
**Created:** [June 26, 2019, 8:09pm UTC](https://forums.balena.io/t/release-with-webpack-and-electron/17226 "2019-06-26T20:09:50Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![AdamLee](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/adamlee/32/2149_2.png) [@AdamLee](https://forums.balena.io/u/AdamLee)\
**Post date:** [June 26, 2019, 8:09pm UTC](https://forums.balena.io/t/release-with-webpack-and-electron/17226/1 "2019-06-26T20:09:50Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![nghiant2710](https://avatars.discourse-cdn.com/v4/letter/n/90db22/32.png) [@nghiant2710](https://forums.balena.io/u/nghiant2710)\
**Post date:** [June 27, 2019, 8:27am UTC](https://forums.balena.io/t/release-with-webpack-and-electron/17226/2 "2019-06-27T08:27:37Z")

</div>

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).

---

<div class="post-metadata">

**Author:** ![mikesimos](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/mikesimos/32/1418_2.png) [@mikesimos](https://forums.balena.io/u/mikesimos)\
**Post date:** [June 27, 2019, 8:27am UTC](https://forums.balena.io/t/release-with-webpack-and-electron/17226/3 "2019-06-27T08:27:38Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![AdamLee](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/adamlee/32/2149_2.png) [@AdamLee](https://forums.balena.io/u/AdamLee)\
**Post date:** [June 27, 2019, 6:03pm UTC](https://forums.balena.io/t/release-with-webpack-and-electron/17226/5 "2019-06-27T18:03:16Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![AdamLee](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/adamlee/32/2149_2.png) [@AdamLee](https://forums.balena.io/u/AdamLee)\
**Post date:** [June 27, 2019, 6:24pm UTC](https://forums.balena.io/t/release-with-webpack-and-electron/17226/7 "2019-06-27T18:24:07Z")

</div>

Just for completions sake, I added this line prior to the call to run start.sh:

# Build distributions

RUN JOBS=MAX npm run build

---

<div class="post-metadata">

**Author:** ![chrisys](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/chrisys/32/1731_2.png) [@chrisys](https://forums.balena.io/u/chrisys)\
**Post date:** [June 27, 2019, 6:36pm UTC](https://forums.balena.io/t/release-with-webpack-and-electron/17226/8 "2019-06-27T18:36:41Z")

</div>

Thanks for following up!
