How to distribute a built executable constructed using electron-builder

感情迁移 提交于 2020-06-01 07:42:06

问题


I have recently packaged an electron app using electron-builder:

myProject/
├── package.json
├── app/
└── release/

All files created by electron-builder are place in the release directory. The executable works fine on my local machine, with all features present through the packaged app.

However, once I move the application to another machine only some features are available. Noticeably features within subdirectories in app/ are not included.

For example here a snippet of the app/ directory:

app/
├── app.html
├── index.js
├── components/
└── other files and folders

Features added from .js/.html files within components/ are not present when I move the app to another machine. I have tried both moving just the executable as well as the whole release/ directory, neither includes additional features beyond what is included in app.html.

Update

It does indeed look like any other machine simply doesn't read items contained in

<script></script>

In my app.html file

Would there be some outside installation I need to do on another machine to get this executable running


回答1:


Found the issue,

It involved my usage of a two package.json structure

Both dependencies and devDependencies of my build were located in the root/package.json, where dependencies needed to be moved to the app/package.json file



来源:https://stackoverflow.com/questions/61806902/how-to-distribute-a-built-executable-constructed-using-electron-builder

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!